Add internal qt_qmlIdForObject to retrieve the id for a given QObject in a context.

This is useful for testing frameworks built around QML.

Change-Id: I37e57f2c1e758f6e999c72e95d2df538faee5d36