emulate SOCK_CLOEXEC and SOCK_NONBLOCK for old (pre-2.6.27) kernels