Fix platform check android device problem

Use typeof Titanium.API to check Titanium environment to prevent crash on some Android devices.

Tested device:
* Samsung Galaxy Note II
* Samsung Galaxy 7

Error log before fix:
[ERROR] JNIUtil: Couldn't find Java class: ti/modules/titanium/platform/PlatformModule

Signed-off-by: Justin Lee <lis186@gmail.com>