Close the stream after writing.
Merge pull request #816 from ycombinator/close-stream-to-cf

Close the stream after writing.