api.c: add support to attach tid to an empty cgroup v2
Currently, cgroup_attach_task_pid() checks for enabled
controllers before attaching the given tid to it, but in the case of
empty cgroup, it simply ignores the attaching due to no controllers
available, a.k.a. cgroup->index is 0. Add support to recognize empty
controller cgroups.
Fixes: https://github.com/libcgroup/libcgroup/issues/129 Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com> Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>