Fix crash when accessing var properties in objects with invalid context

We've had two indepedent reports of people running into the issue of
their QML code accidentally trying to access var properties in item view
delegates that were on the path of destruction, i.e. their QQmlContext was
already marked as invalid. Any such access would cause a failing assertion
in debug builds or a crash in release builds.

This patch removes the dependency to QQmlContextData for accessing the
var properties and adds a test-case that covers this use-case.

This is a regression from Qt 5.1.x.

Task-number: QTBUG-37227
Change-Id: Icf55d5fa8c15e45974e78086e9e11b2401ea9bad
Reviewed-by: Albert Astals Cid <albert.astals@canonical.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Fix crash when appending arrays to sub models in list models

The elements are still inaccessible, but at least it doesn't crash. This is
consistent with the behavior in Qt 5.0, where it didn't crash because the v8
object handle returned an empty array for the property names because the
individual array element wasn't an object.

Bug QTBUG-12117 tracks support for arrays in list models.

Task-number: QTBUG-35891
Change-Id: Ief446341344977a1473bca474ca5ba934e950468
Reviewed-by: Albert Astals Cid <albert.astals@canonical.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Merge pull request #11 from mbrasser-jolla/mer-stable

Fix potential crashes