state: only update API host ports if changed

If the API host ports haven't changed, don't
update them. This avoids spamming the transaction log
with unnecessary writes.

Fixes https://bugs.launchpad.net/juju-core/+bug/1345832
This method is now inherently racy but I don't think there's a choice given the limitations of what can be done using the mgo driver's txn abstraction. I guess it comes down to last one wins.