timob-15877: Fix keyboard regressions

Testing steps in JIRA: https://jira.appcelerator.org/browse/TIMOB-15877
Please also test cases in https://github.com/appcelerator/titanium_mobile/pull/4825