Re #8459. Use Poco::AutoPtr to ensure memory is released.

This clears memory leaks highlighted by valgrind in the Kernel unit tests.
Re #8459. Use Poco::AutoPtr instead of manually releasing memory.
Merge branch 'bugfix/8459_poco_xml_leaks' into develop