Making onExit do a better job of cleaning up if the user presses
the Exit button while the login process is running.