progressively flushing error info in order to reduce memory consumption. blocking row insertion when failed queue is filled by too many requests.
Add dedicated thread for writing errors into disk.
change few static variables to non-static. make sure all error info are written to file properly.
remove unnecessary trailing whitespaces.
Merge pull request #1423 from viirya/fix_csvloader

ENG-6490: Fixing out of memory errors during CSV data import