Fix crash in pixmapToImageData binding

The result of JSContextGetGlobalObject is a wrapper-object not a
direct pointer to the global object. Instead access the global object
directly since we are already using other parts of the internal JS API.

The patch also adds a missing API shim that should be held when using the
internal JS API.

Task-number: QTBUG-38809
Change-Id: I76eccbbd6cb1b9fd3322596bb7d6a3f9b0e694b8
Reviewed-by: Michael Bruning <michael.bruning@digia.com>