Avoid race condition in QQmlEngine on shutdown.

The QQmlTypeLoader was deleted (and its thread shut down) when
the QQmlEnginePrivate was destroyed. However, the QQmlTypeLoader
runs a thread which would happiliy make calls on the engine and
its managed data. Fix this by stopping the QQmlTypeLoader's
thread right away in QQmlEngine.

Task-number: QTBUG-39905
Change-Id: Ida8e95d083f79237c74b036fd3521133a9fa4ac7
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>