CTest: fix crash if source file for coverage cannot be found

The opened XML elements were not closed, so an assert was triggered when the
file was finally closed. If CMake is built with assertions disabled then an
invalid XML file will be produced.
1 file changed