api.c: Verify if a controller is enabled for a v2 cgroup
Add a function, cgroupv2_controller_enabled(), that checks if the
requested cgroup v2 controller can be used for the specified path.
Again, in cgroup v2, to use a controller, it must be added to the
parent cgroup's cgroup.subtree_control file.
This check is required to ensure that the cgexec and cgclassify
operations will succeed. And with this commit, cgexec and cgclassify
work on both cgroup v1 and cgroup v2 hierarchies.
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>