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.
Re #8459. Switch to Poco::AutoPtr instead of manually releasing.

Although release was being correctly called in this case, it's better
to use AutoPtr.
Re #8459. Replace manual release() calls with Poco::AutoPtr.

There were no leaks, but this is better and exception-safe.
Merge remote-tracking branch 'origin/bugfix/8459_poco_xml_leaks'