api.c: fix string termination in cgroup_get_procname_from_procfs()
Fix non-terminated string warning, reported by Coverity tool:
CID 258273 (#2 of 2): String not null terminated (STRING_NULL)6.
string_null: Passing unterminated string buf to strdup, which expects a
null-terminated string.
use snprintf() instead of sprintf(), to string terminate
cgroup_get_procname_from_procfs().
Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com> Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>