Fixed crashes in login control

Logging or registering while MySQL was down caused the server to crash