Don't allow popups during page unloading times.

Precisely, this disallows them when the event loop's
termination nesting level is nonzero.

This is now part of the spec,
https://html.spec.whatwg.org/#apis-for-creating-and-navigating-browsing-contexts-by-name

> The window open steps, given a string url, a string target, and a string features, are as follows:
> 1. If the event loop's termination nesting level is nonzero, return null.

BUG=844455

Change-Id: I85fb003063f5ed051049c7c263391835421902ac
Reviewed-on: https://chromium-review.googlesource.com/c/1180296
Commit-Queue: Avi Drissman <avi@chromium.org>
Reviewed-by: Nate Chapin <japhet@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#605025}
8 files changed