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
> But I guess this can be ignored - it's simply that mgo/txn does not make guarantees about txn-revno being incremented by 1 on each op.

Fair enough. I will update the test.