Revert: TIMOB-12930: Reduce redundant checks on env

The fix for TIMOB-12930 seems to be breaking anvil.  This PR reverts that commit:

https://github.com/appcelerator/titanium_mobile/pull/3933

https://jira.appcelerator.org/browse/TIMOB-12930