Add cancel button to login. Closes #3318.
Add defer canceling to the app quit method.