Handle main window close event.