iOS: RCTTestRunner should deallocate rootview before invalidating the bridge
iOS: RCTTestRunner should deallocate rootview before invalidating the bridge

Summary: There are cases of race condition where the react component being mounted is calling a nativemodule from JS *right after* the test runner starts invalidating the bridge. This causes assertion failure deep in the RCTModuleData such that the bridge doesn't complete the invalidation. To avoid this, unmount and deallocate the RCTRootView before invalidating the bridge.

Reviewed By: sahrens

Differential Revision: D7727249

fbshipit-source-id: 8b82edc3b795ceb2e32441f16e225d723fcd9be1

exponent/react-native,hammerandchisel/react-native,exponentjs/react-native,pandiaraj44/react-native,arthuralee/react-native,myntra/react-native,hoangpham95/react-native,hammerandchisel/react-native,facebook/react-native,facebook/react-native,pandiaraj44/react-native,pandiaraj44/react-native,javache/react-native,janicduplessis/react-native,arthuralee/react-native,janicduplessis/react-native,javache/react-native,myntra/react-native,exponentjs/react-native,javache/react-native,janicduplessis/react-native,myntra/react-native,facebook/react-native,exponent/react-native,pandiaraj44/react-native,hoangpham95/react-native,hoangpham95/react-native,facebook/react-native,hoangpham95/react-native,javache/react-native,myntra/react-native,facebook/react-native,arthuralee/react-native,hammerandchisel/react-native,myntra/react-native,pandiaraj44/react-native,pandiaraj44/react-native,hoangpham95/react-native,hammerandchisel/react-native,arthuralee/react-native,facebook/react-native,hoangpham95/react-native,myntra/react-native,exponent/react-native,javache/react-native,pandiaraj44/react-native,hammerandchisel/react-native,javache/react-native,janicduplessis/react-native,myntra/react-native,javache/react-native,exponent/react-native,exponentjs/react-native,facebook/react-native,hoangpham95/react-native,javache/react-native,arthuralee/react-native,exponent/react-native,hammerandchisel/react-native,exponentjs/react-native,exponent/react-native,myntra/react-native,myntra/react-native,exponentjs/react-native,exponentjs/react-native,exponentjs/react-native,exponentjs/react-native,janicduplessis/react-native,hammerandchisel/react-native,janicduplessis/react-native,pandiaraj44/react-native,hoangpham95/react-native,exponent/react-native,exponent/react-native,janicduplessis/react-native,janicduplessis/react-native,facebook/react-native,facebook/react-native,hammerandchisel/react-native,javache/react-native