Delete client main window on exit correctly.

This mainly works around a bug in Qt, that caused the gammaray client
process to never quit, because of a dead lock that happens when a
main window, containing a QQuickWindow, is deleted from within
~QCoreApplication().
Still cleaning up correctly is always a good thing.