Also call stopWriting when unpiped.