Fixed problem on OS/X

Fixed problem on OS/X; SOCK_CLOEXEC raises EPROTONOSUPPORT instead
of EINVAL.
Avoid warnings during clang compilation

Match class/struct in both definition and declaration
Avoid to assign member field to itself
Added clang to travis compilation