cgroups: fix race between userspace and kernelspace