Correctly close the wxmx output file.