Allow users to log in using their e-mail address.

One thing that sometimes happens is that users will try to log in using their
e-mail address instead of their username, and then get confused when it doesn't
work. This is exacerbated by the fact that our sessions last a long time, so
it's often been a very long time since users had to log in.

This change makes it so that if a user logs in, and the username isn't found,
it will try to look up their user by e-mail address.

Testing done:
Logged in to my devserver using both my username and my e-mail address.

Reviewed at https://reviews.reviewboard.org/r/6103/
Merge branch 'release-2.0.x'