cmd/jujud: upgrades test refactoring

A bunch of refactoring of the tests relating to machine agent upgrades.
is this going to be a data race ?