Fix a race between quit() and exec(). If quit() was called before exec() the following wait() would block indefinitely. Can be triggered by the Akonadi IMAP resource when quickly changing configuration or the online/offline state, mostly affected the automated tests.
svn path=/trunk/KDE/kdepimlibs/; revision=985227