Make sure solid backends are reentrant
Summary:
Solid will create different backends for each separate thread but then some backends will use singletons to share some information.
This patch includes measures so this sharing only happens within the same thread or adds the necessary locks so threads respect each other.
Test Plan: Tests pass, logic makes sense to me, plasmashell doesn't crash when using D22333 (not that it fixes any crashes there)
Reviewers: Frameworks, davidedmundson, bruns
Reviewed By: davidedmundson
Subscribers: bruns, kde-frameworks-devel
Tags: Frameworks
Differential Revision: https://phabricator.kde.org/D22339