IPC: move utility functions to unix.c

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>