Fully unpipe the stream on error

fixes #23
closes #24