Fixed race condition when waiting for the cgroups to be created