[libc] Resolve race condition in sub-process test runner.