Fixed bug where Apple internal non key windows could be made key window (for instance UITextEffectsWindow). Checking for root view controller nil seems to solve this issue