Quit the app when close the main window.