Suport email as login

Added more logic to the smf-auth file to check to see if the login is an
email or not. If it's an email, it'll look up the username by the email.
Then try to login with the username and password. If the login is the
username, it'll just login normally with the username and password.

If there is an error at any point, the whole process will quit and
return while closing all connections to the DB.

This allows users to login with either their username or their email.