Prevent CGroup object deletion from crashing the application
In certain cases, a race condition seems to come up where the PID retrieval thread tries to set the PIDs while the cgroup object is being deleted. So lock the mutex in the destructor, so that if that should happen, destruction will block while the PIDs are being updated.