Fix data race in the process management.