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
I'm not sure assertions should be made on the way txn-revno's change (other than the fact that they increment).

	var txnRevnoExpected int64
	// Second call should not update txn-revno.
	for i := 0; i < 2; i++ {
		err := s.State.SetAPIHostPorts(hostPorts)
		c.Assert(err, gc.IsNil)
		revno, err := state.TxnRevno(s.State, "stateServers", "apiHostPorts")
		c.Assert(err, gc.IsNil)
		if i == 1 {
			txnRevnoExpected =  revno
		}
		c.Assert(revno, gc.Equals, txnRevnoExpected)