api.c: add support to build procs path for cgroup.thread
In cgroup_build_tid_path(), add support for building path to write
tid into cgroup.thread instead of cgroup.procs, if the calling function
is cgroup_attach_thread_tid() or else build path to write into
cgroup.procs.