Wait for dev server restart after `next.config.js` changes in tests (#67601)
This allows us to change the `next.config.js` file before a test with an
already running dev server, without getting connection issues because
the dev server may not have restarted in time for the next test to
trigger requests.