cg: Helper for type to bit conversion

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
ct: Sanitize ct spawning

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
ct: Handle situation when spawn fails before calling user cb

This can happen if we e.g. fail to mount proc or external
bind mounts or attach to cgroups. In that case we should
report error from spawn API call.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
ct: Helpers for pipe-based synchronization

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>