LDAP login stored a raw DB::admins row as $c->user, so API response
logging failed when fetching the OTP QR after an invalid OTP on
login_jwt. Wrap the admin in RoleFromRealm, pass the admin auth realm
to set_authenticated, logout on OTP failure, and make Message logging
tolerate raw user rows or role lookup failures.
Change-Id: I29fda2324eadc7fb1f25f06ae6418ab594b69fa0
(cherry picked from commit 70d5c894a6)