Revert "Fix inability to close pipe in "expecting chunk" state"

This reverts commit acc3b1cda216623a2c84d4c27a5ace56d3986639.

This fixes issue #29.