Issue #12650: fix failures on some buildbots, when a subprocess takes a long
time to spawn.