preserve line endings further in the output chain

This should allow better capture of `\r`'s
fix bug which caused repeated lines in the output