Fix saving CSV files with Python 3