Close main window rather then QApplication.exit()