[TIMOB-14292] Avoid race condition on view detach

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