When attempting to write to a socket that is not connected or - for connection-less protocols - doesn't have a peer address set we should return EPIPE instead of blocking the thread.