Moved the pipeline closing to the Close() function

This would cause a panic() if 2 (or more) chunks failed at the
same-ish time (closing an already closed channel)