When a QApplication is in it's destructor it calls window->destroy()
on all remaining QWindows. This deletes the platform window, whilst
keeping the real object alive. QtWayland doesn't like this.
Deleting the dialog fixes the issue. The deleteLater is fine because
QCoreApplication teardown is magic.