Fixed issue with android crashing.

Fix for android error:
E/hxcpp   ( 5338): GetLocalAllocMT - requesting memory from unregistered thread!
F/libc    ( 5338): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 5355 (Thread-3966)