PERF: use lib.write_csv_rows for encoded data when writing to csv
right now we take a different path for encoded input, and the encoded input is basically a python writer, while non-encoded input writes per-block and is done via cython.

Ideally could fold the encoded writer into the current writer.
