Bug 865547 some tests would end without waiting for their windows/tabs to close