[Fix bug 1111549] Handle race condition on user authentication.