Check to see if the temp directory exists before trying to write to it.