Rewrite state parts on version change

If a node is upgraded, reads and caches a version of cluster state written by
a node yet to be upgraded, then later becomes master and pubishes state it needs to
rewrite the state parts rather than using cached parts written by previous version.