Fixed issue: CsvWriter fails if UseInvariantCulture is set

I added a test which failed and fixed the code. If you want me to change something let me know.