cgmanager: pull _main fn prototypes to top

And give them commonized arguments

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
cgmanager: commonize the ${method}_scm_readers

Put the differentiators into ${method}_complete functions,
so that the bulk of the boilerplate can go into
a generic sock_scm_reader.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
cgmanager: commonize the ${method}_scm functions

pull the boilerplate into one function which allocates the
scm_sock_data struct;

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
add comment above file_read_string to warn against general i/o use

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>