Using RPC (wait_for_rpc_connection) has several issue:
It polls in a loop, which might be slow It tries to read the RPC cookie file, which might not be present, thus leading to intermittent issuesFix both by using Popen.wait
This is a backport of core#20613