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

This test breakage blames to e1c2d02fddb40cb0b246d2c2da97b41b6ba378bc.

cc @petehunt
Let's be consistent with our other patterns (and also types).

`ExecutionEnvironment.canUseDOM ? window : null`