[TIMOB-18175] Check if ViewController dismissal

Fixes [TIMOB-18175](https://jira.appcelerator.org/browse/TIMOB-18175)