cmd/jujud: restrict API logins during upgrades

Use the recently introduced API login validation functionality to only allow client and local machine agent logins while upgrade steps are running. The goal is minimise database activity during upgrades, specifically for schema migrations.

As well as the unit tests, this change has been heavily tested manually.

Comment here. something like "returns an error if upgrade is in progress and the authTag provided in creds is not a user or machine tag."