Bug 933483 - Don't fire events (and especially request animation frame events) when we're in a modal dialog. Also protect ourselves from resuming events on a closed window. r=smaug