More experiments.

Mystery solved: why was writing to a csv failing with a closed stream?
Answer: I realized the a lazy sequence containing the write-csv calls
outside of the with-open block.  (Seems obvious now.)