Fixes #1140 Captcha doesn't show up after too many failed login attempts

#1140

I updated some files to make use of the new `get_user_by_username()` function (no sure how those were missed).