lib: Use SOCK_CLOEXEC where needed

Calling programs might fork().. execve() and we will end
up leaking fds.
2 files changed