Performance improvement for opening HW window. (TIMOB-13714)

This PR is to improve the performance in opening HW window. (details in TIMOB-13714)
Please run the test case in TIMOB-7584 https://jira.appcelerator.org/browse/TIMOB-7584 and KS to make sure there is no regression.