Also catch instances of socket.error in case of a broken pipe message