Fix race condition when reaping children on Linux.