[TIMOB-17712] iOS8: Avoid race condition on dismissal of modal window

Test is in [JIRA](https://jira.appcelerator.org/browse/TIMOB-17712)