Bug 812417: Listen for domwindowclosed instead of unload when closing a toplevel window.

https://bugzilla.mozilla.org/show_bug.cgi?id=812417