Bug 833783: Fix leaks in tabs and windows when closing a top-level chrome window.

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