apiserver: changed login failure handling during upgrades and restores

Login attempts may fail during upgrades or restores due to data
manipulations performed (or not performed yet) by these
operations. Instead of reporting a "bad credentials" error in this
case, which is confusing to users and causes unit agents to terminate,
return "maintenance in progress" instead.

Fixes LP #1372752.