If the API host ports haven't changed, don't

update them. This avoids spamming the transaction log
with unnecessary writes.

(Cherry pick from trunk)

Fixes https://bugs.launchpad.net/juju-core/+bug/1345832