In preparation for fixing the bug, discovered minor glitches
in the open/lock/close logic on error paths. Using the RAII syntax
for xml_file and removing redundant unlock-before-close.
The parse errors now have friendlier verbiage, give action suggestions,
and point to the actual file location for better usability and
maintainability.