Fix SessionThread dtor timeout when destroying default Session
The default Session does not have any owner and is managed by QThreadStorage, so it is only destroyed when QApplication is being destroyed. Because at this point event loop is no longer running, SessionThread::doThreadQuit() is not invoked from SessionThread dtor and we hit the 10 seconds timeout. This affects especially unit-test which take less than second to execute, but then get stuck for 10 seconds in the SessionThread dtor during clean up. Since the new code relies on QCoreApplication::aboutToQuit() to destroy the default Sessions while qApp is still running we had to adjust AKONADITEST_MAIN() a little to start the QApplication event loop, because otherwise the signal is not emitted.
Showing with 27 additions and 4 deletions