cmd/jujud: reattempt api.Open if IsCodeNotProvisioned

There is a race between the machine agent starting and
the provisioner recording its instance ID in state.
We modify the agent's logic around opening API
connections to retry for up to one minute if it receives
an error satisfying IsCodeNotProvisioned.

Fixes https://bugs.launchpad.net/juju-core/+bug/1345014
> i don't think this makes things clearer, could you put it back please.

No. It wasn't meant to make anything clearer. This is necessary so that the new api.Open uses the right password.