fix core on broken pipe when calling
sendChunk() and socket in streaming mode.