Check against EPIPE errno and make extra sure threads don't leak
Check against EPIPE errno and make extra sure threads don't leak

Previously there was a chance to leak the thread filling the other end
of the pipe if the main thread encountered an exception.

BD2KGenomics/slugflow,BD2KGenomics/slugflow