Fix performance hit in the CSV export plugin.

The previous version of the plugin scanned the entire csvData set when replacing the last comma with a newline. This is a huge performance hit for large datasets.

This version only scans the current row to replace the comma with a newline.