Get network_linux.c to build under MacOS X

This patch works on my 10.9.2 box.   I have a further small patch that ensures that the new `SO_NOSIGPIPE` `setsockopt` call isn't made if the `connect` call fails, by adding a `closesocket()` and `return -1` to the `net_linux_createsocket` function.