Fixed a potential DoS attack.

This is caused when using database authentication and a user
keeps trying to login with an invalid password.