Fix tests broken by undefined `window` references in ReactEventListener.

This test breakage blames to e1c2d02fddb40cb0b246d2c2da97b41b6ba378bc.

cc @petehunt
Right, that would be a good place to put it. Pete already had a version here:

https://github.com/facebook/react/pull/1434/files#diff-61