Bug 1001833 - "TypeError: can't access dead object" due leaks of event/dom module

This is the simplest approach to remove the listeners added previously, that I could think.
Alternatively we could create a Map object and create a Set / Array where we store an object with `type`, `listener` and `capture`, and iterate it during the unload to remove the listener. But the code will be a bit overcomplicated, and if there is no specific reason to avoid to calling `unload` for each `open` call, I don't think it makes sense.