Use MSG_CMSG_CLOEXEC with recvmsg

Signed-off-by: Rick Taylor <rick@tropicalstormsoftware.com>
Templatize the socket pointer with CDRIO

Signed-off-by: Rick Taylor <rick@tropicalstormsoftware.com>