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.

It is possible to do it non-racily (see state/Machine.SetAddresses), but it didn't seem worthwhile. At worst we'll either miss updating (but it'll be called periodically anyway, so eventually updated), or we'll do a spurious re-write of the same data.