Allow a validate login hook to override error from beginPasswordExchange

Fixes #2058