Move the parsing of a login failure response into mailimap_helper,
and share it with mailimap_login so that the same logic applies
when signing in with a password.