Figure out nested wayland dismantle
Fixes a crash we would get, we're changing 2 main things:
- release the event queue first, otherwise we'd serve events to
- destroy the connection thread object after the thread has quit.
Test Plan: KWin doesn't explode when closing.
Reviewers: KWin, davidedmundson
Reviewed By: KWin, davidedmundson
Subscribers: davidedmundson, kwin
Differential Revision: https://phabricator.kde.org/D28340