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.

I think it'd be a bit cleaner to leave this as a func, and take its value in the jujud package. e.g.

```go
package jujud

var upgradesPerformUpgrade = upgrades.PerformUpgrade
```

Then export its address in `export_test.go` so you can patch it.