Use AutoPtr in those cases where release() is used re #8485

Signed-off-by: Karl Palmen <karl.palmen@stfc.ac.uk>
Merge branch 'feature/8485_poco_xml_autoptr' into develop