SSP-2859 Guard against NoSuchElementException in CSV writer