[qtdeclarative] 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.
Merge pull request #41 from adenexter/master

[qtdeclarative] Fix crash on QQmlEngine destruction.