static: Factor out "error" function on login screen.

To make it easier to produce errors in multiple places.
ws, static: Only allow admin users to log in.

This is a HACK until Cockpit behaves more rational for non-wheel
users, by which time this whole commit should be reverted.