Fix race conditions in tests.
Fix postMessage assert issues on FF4