Revert "Revert "Squashed commit of the following:""

This reverts commit 656155db64eeb770bd929338ef5416b96ca79a13.
Destroy render loop when QCoreApplication is cleaned up.

Doing it on 'aboutToQuit' meant we would clean it up whenever an
application ran QCoreApp::exec() which could be multiple times
per application run.

Change-Id: I59e06398a551ae7979e3832dff811937037fa106
Merge pull request #7 from sletta/next

[qtdeclarative] Revive previous revert and fix startup problems.