TIMOB-15248-Added null check for activity

Added null check for getCurrentActivity and getAppCurrentActivity as this could return null during app shutdown.

https://jira.appcelerator.org/browse/TIMOB-15248