Make sure we don't call waitpid() twice for the same process