Make QML import thread safe.

Protect the common qmlEnginePluginsWithRegisteredTypes by a mutex.

Task-number: QTBUG-36542
Change-Id: Ia3c731f030b778d862239486cc6c1bfa441503e6
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Make the QML debug server thread safe

Previously, if instance() was accessed concurrently we could run into
various problems as the initialization wasn't synchronized. By putting
most of the initialization into the constructor, wrapping it into a
Q_GLOBAL_STATIC and discerning between accesses that need to wait for
the initial "hello" packet and ones that don't the situation is
improved.

Change-Id: I182e8e6abf054b851ef7ea5f897d4a197a9da4bf
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>