cmd/jujud: fixed unreliable TestLoginsDuringUpgrade test

This test has been unreliable since the introduction of the certupdater worker. This worker restarts the API server after upgrades have completed, often breaking the API connection used by this test (timing dependent).

Instead of starting the whole machine agent, TestLoginsDuringUpgrade now just starts the specific workers required for the test, avoiding the unwanted effects of other workers. This also makes the test significantly faster.

Some refactoring of the machine agent was required to support running of the specific workers required.

Fixes LP #1400358.