Qt UI: fix main window closing for Mac OS X (final step)