Check if duk_create_heap() succeeded.

Also eliminate a double call to duk_create_heap().