Fix recursive BrokenPipeException on disconnect