Added machine nonce in OpenAPI/Login for machine agents
Merge trunk
Changes after review
added a test and fix for bug lp:1199432
[r=fwereade],[bug=1199432] Bug fix for lp:1199432

Currently an empty config supplied to charm.ReadConfig causes a panic, it would be better to return an error. lp:1199432

https://codereview.appspot.com/11542046/
Renamed api.Info.MachineNonce to Nonce, as suggested
Typo
Merge trunk
[r=dimitern] api: Use MachineNonce when opening API as MA

This introduces an extra field in api.Info:
MachineNonce, which needs to be set when
opening/logging in into the API server as
a machine agent (ignored in other cases).
The server ensures the connecting machine
agents won't operate on a wrong or unprovisioned
machine (in the latter case they shouldn't
run anyway and now they stop immediately after
starting).

Added tests for the behavior in apiserver.
It might seem there are a lot of changes,
but that's because it touches one of the
basic types api.Info and how API connections
are established.

These changes will be followed up by another
branch which starts and stops a pinger at
the apiserver automatically when a machine
agent connects successfully, so that we can
get rid of SetAgentAlive eventually.

https://codereview.appspot.com/11424044/

R=fwereade, rogpeppe