Write upgraded to version even when no upgrade (v1.20)

This is the 1.20 backport of https://github.com/juju/juju/pull/566.

See also: https://bugs.launchpad.net/juju-core/+bug/1359484