dot-writeResultsToCsv function

Internal function to write the check results to a csv file.