cmd/jujud: extract the upgrade steps worker

Make the upgrade steps worker code more testable by ripping it out of
the machine agent.
cmd/jujud: rework upgrade tests

Take advantage of extracted upgrade steps worker. The upgrade tests
are now significantly simpler and faster.