merge sock_alloc_fd/sock_attach_fd into a new helper