Allow validate login hook to override error from beginPasswordExchange

Fixes #2058
one more comment.
Merge PR 2081 into devel