Bug 812417: Listen for domwindowclosed instead of unload when closing a toplevel window.
Merge pull request #948 from ochameau/bug812417-2

Bug 812417: Listen for domwindowclosed instead of unload when closing a toplevel window. r=@mossop