[client] Track all created ConnectionThreads and add API to access them

Authored by graesslin on Jul 8 2017, 12:34 PM.

Description

[client] Track all created ConnectionThreads and add API to access them

Summary:
This is change needed by KWin. KWin has the problem that it destroys its
internal Wayland connection (KWin as client for KWin as server) before
shutting down the application. Other external libraries loaded into KWin
(e.g. breeze window decoration) are unloaded later on, then try to clean
up their Wayland resources and crash KWin due to accessing a no longer
valid Wayland connection.

With the help of this new API KWin can access all connections during
the clean up and destroy them before shutting down the Wayland server and
thus exit cleanly.

Reviewers: Frameworks, Plasma, KWin

Subscribers: plasma-devel

Tags: Plasma on Wayland, Frameworks

Differential Revision: https://phabricator.kde.org/D6569