timob-14772: Detach fragment appropriately

testing steps in JIRA: https://jira.appcelerator.org/browse/TIMOB-14772