Update to tests for kml and results file writers and minor fixes

added microseconds to output filenames, so more than 1 can be printed at
a time during testing
fixed bug that caused empty files to be created when an error occurs
during file writing