Use SO_NOSIGPIPE or MSG_NOSIGNAL based on platform (issue #49)