Wait for the Quit event to be delivered before really quitting
I think this is a problem either in Qt or in gnome-session, but we can "easily" workaround it ourselves, and could not find how to fix it "properly" so this seems like an acceptable workaround to me.. Fixes: https://bugs.launchpad.net/bugs/812104. Appoved by Gerry Boland.