Check the incumbent document's sandboxing flags in window.close()

Check the incumbent document's sandboxing flags in window.close()

This regressed in 0a97a81da.

Tests: https://github.com/web-platform-tests/wpt/pull/62903.