[wptrunner] Close extra test-opened windows before checking for leaks (#48809)
This behavior is similar to that of content_shell
0 and is needed to
avoid bogus failures. Fixes https://crbug.com/374852560.
Tested locally in chromium/src
with:
git cl patch https://crrev.com/c/5951685/4
run_chrome_wpt_tests external/wpt/nav-tracking-mitigations/leftover-window.sub.https.html \
-v --enable-leak-detection