Split cgroup removal to separate functions.
Split cgroup removal to separate functions.

Changelog:
- simplify error handling in cg_move_task_files

cgroup_delete_cgroup does all the stuff on it's own. This patch refactors
the function and moves the parts with complete error handling.

The new functions are cg_delete_cgroup_controller and cg_move_task_files.
They are not necessarily needed, but it simplifies error handling and clearly
distinguishes functionality of cgroup_delete_cgroup.

Purpose of the functions should be clearly specified in the doxygen comments.

Especially note that cg_delete_cgroup_controller wants already opened file,
where all tasks should be moved - this is optimization, which will be used in
subsequent patches. I could use cgroup_get_task_* and cgroup_attach_task, which
would look definitely nicer, but it would lead to lot of fopen() and fclose()
calls. Let me know what do you think about it.

Signed-off-by: Jan Safranek <a7f4b96ffdd515ecef00f117294da18555749b0b@redhat.com>
Signed-off-by: Dhaval Giani <9e8a88f272eaf8af1eb7757146d1fb3d7f128182@linux.vnet.ibm.com>

rafalmiel/libcg,jrfastab/Linux-cgdcbxd,jrfastab/Linux-cgdcbxd,jrfastab/Linux-cgdcbxd,jrfastab/Linux-cgdcbxd,rafalmiel/libcg,rafalmiel/libcg,rafalmiel/libcg