Cgroup fixes

A bunch of cgroup fixes to make the cgroup monitor behavior more resilient.