Fix crash on QQmlEngine destruction.

QQmlTypeLoader references QQmlImportDatabase in a thread, so change the
declaration order so QQmlTypeLoader is destroyed and its thread stopped
before QQmlImportDatabase is destroyed.

Change-Id: If1f8ef0a5ce56103a417ecfb6897d2c3b9c8d364
Done-with: Andrew den Exter <andrew.den.exter@jollamobile.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>