Fix a memory management issues with the name map in internal classes

The string pointer we store in the nameMap is not marked directly, i.e. our
class hierarchy doesn't have a recursive mark() function. So we must otherwise
make sure that that string is marked, otherwise we get dangling pointers that
are likely to point to _other_ strings later. This is hard to reproduce, but it
does happen with MM_AGGRESSIVE_GC=1 and the singletonType test in
qqmlecmascript, when due to the dangling pointer we end up using the wrong
property name in freeze() when iterating through the name map.

This patch fixes that by storing the actual identifier string, that's
guaranteed to get marked.

Change-Id: I28d1a2d2f56fe3abf692229ba008af8b0789189e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Fix expected error messages in singleonType test

Writing to a property of a frozen object doesn't throw a type error
exception in non-strict mode.

Change-Id: I408078a2a09d16868b95f275f13f2f7a176f66e9
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Fix tst_qqmlecmascripts::importScripts with private imports

* In QQmlContextWrapper::get we must check the calling context before
  allowing the get, just like in the Getter() in qv8contextwrapper.cpp
* When trying to call a method on undefined/null, throw a readable error message,
  as expected by the test.

Change-Id: Ie39e8ae82a108deef264e4044e12e7b15959caf9
Reviewed-by: Lars Knoll <lars.knoll@digia.com>