Previously when using --xml=FILE the beginning of the XML file would be
written to FILE, while its ending would either (1) not be written at all
(no -l/-L option), or (2) be written to RESULTS.xml in the directory
specified using -l/-L. This patch ensures that the ending of the XML
file is always written to the correct file.