on some kernel releases, SOCK_CLOEXEC is defined but not implemented

This means a compile switch cannot be used, so we wrap the socket calls behind
a function switch.  Initially try the flag and if it fails, try without and
flip the switch to prevent further attempts.
win32 fix, enable prototypes, and avoid shared libgcc