Properly exit nested event loops when a tab is abruptly closed (bug 942931). r=fitzgen