Move file writing out of argument loop in dzil add

Previously, on a second entry the file generated in the first would be written again, which resulted in an error. Now it is written after all files have been generated.