[os_xml] always ensure a freeable xml structure state
[tests] fix memory leaks
[os_xml] fix memory leak
[tests] enable conversion warnings
[os_xml] fix memory leaks on error paths