allow setting cgroup dir mode

needed for #234, please review