Don't be clever about program termination.
This fixes hangs with current Qt 5.6.
Calling exit() with a QApplication around is not something you
should do. It used to work before Qt 5.6, but currently doesn't
work - it will hang the the main thread. While this should and
maybe will be fixed in Qt, let's also stop taking the risk.
The cause of the hangs seems to be something in the threaded DBus
handling new in Qt 5.6 and involves destructors of global statics.
The signal handler thing is even more risky. There is a concept
of signal handler safe operations, and anything calling into Qt
is probably not a signal safe operation.