qt: FirstRun dialog must be destroyed before closing the application
FirstRun dialog used Qt::WA_DeleteOnClose, it lifecycle would be bound to the QApplication. On close the firstrun dialog will save some changes to the preferences. So we need to ensure the dialog is properly destroyed before the context becomes invalid when closing the application.