Fix crash in qml/qmlscene when using dummy-data with imports

When using the tools qml and qmlscene with dummy-data it will crash or
behave wrong, due to the dummy-data component will get the state not
ready, if the dummy-data qml-files does an import of another folder or
a js-file.  By changing the way of loading dummy-data, by letting
QQmlComponent handle the file opening instead of using the setData()
method, qmlscene and qml will be able to handle this type of
dummy-data.

The tool qml also needed to load the dummy data before loading the
regular components, otherwise the dummy-data would not be ready for the
other components to use.

Task-number: QTBUG-32721

Change-Id: Ia1cc2b2626187e23c7d7313be788202d91b12471
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Fix CompiledData::CompilationUnit object leak

Don't ref CompiledData::CompilationUnit in constructor of ScriptFunction
since its has been referenced in its base class

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