cgroup: Fix None value check and modify the way to create a path with os.path.join()

Signed-off-by: Li Yang <liyang.fnst@cn.fujitsu.com>