Fix significant memory leak in contrib/xml2 functions.
Fix significant memory leak in contrib/xml2 functions.

Most of the functions that execute XPath queries leaked the data structures
created by libxml2.  This memory would not be recovered until end of
session, so it mounts up pretty quickly in any serious use of the feature.
Per report from Pavel Stehule, though this isn't his patch.

Back-patch to all supported branches.

adam8157/gpdb,50wu/gpdb,xinzweb/gpdb,greenplum-db/gpdb,xinzweb/gpdb,techdragon/Postgres-XL,adam8157/gpdb,techdragon/Postgres-XL,adam8157/gpdb,greenplum-db/gpdb,arcivanov/postgres-xl,zeroae/postgres-xl,arcivanov/postgres-xl,Postgres-XL/Postgres-XL,snaga/postgres-xl,zeroae/postgres-xl,snaga/postgres-xl,ashwinstar/gpdb,yazun/postgres-xl,50wu/gpdb,adam8157/gpdb,yazun/postgres-xl,ovr/postgres-xl,pavanvd/postgres-xl,jmcatamney/gpdb,xinzweb/gpdb,lisakowen/gpdb,zeroae/postgres-xl,arcivanov/postgres-xl,postmind-net/postgres-xl,50wu/gpdb,tpostgres-projects/tPostgres,adam8157/gpdb,ashwinstar/gpdb,xinzweb/gpdb,techdragon/Postgres-XL,lisakowen/gpdb,adam8157/gpdb,zeroae/postgres-xl,xinzweb/gpdb,xinzweb/gpdb,adam8157/gpdb,kmjungersen/PostgresXL,greenplum-db/gpdb,ovr/postgres-xl,jmcatamney/gpdb,postmind-net/postgres-xl,lisakowen/gpdb,tpostgres-projects/tPostgres,lisakowen/gpdb,kmjungersen/PostgresXL,oberstet/postgres-xl,jmcatamney/gpdb,Postgres-XL/Postgres-XL,50wu/gpdb,yazun/postgres-xl,pavanvd/postgres-xl,ashwinstar/gpdb,greenplum-db/gpdb,lisakowen/gpdb,techdragon/Postgres-XL,pavanvd/postgres-xl,ovr/postgres-xl,techdragon/Postgres-XL,ovr/postgres-xl,yazun/postgres-xl,xinzweb/gpdb,ashwinstar/gpdb,oberstet/postgres-xl,arcivanov/postgres-xl,oberstet/postgres-xl,jmcatamney/gpdb,yazun/postgres-xl,kmjungersen/PostgresXL,ashwinstar/gpdb,lisakowen/gpdb,Postgres-XL/Postgres-XL,jmcatamney/gpdb,pavanvd/postgres-xl,ovr/postgres-xl,ashwinstar/gpdb,jmcatamney/gpdb,postmind-net/postgres-xl,zeroae/postgres-xl,pavanvd/postgres-xl,ashwinstar/gpdb,snaga/postgres-xl,snaga/postgres-xl,kmjungersen/PostgresXL,postmind-net/postgres-xl,jmcatamney/gpdb,greenplum-db/gpdb,lisakowen/gpdb,snaga/postgres-xl,tpostgres-projects/tPostgres,jmcatamney/gpdb,oberstet/postgres-xl,tpostgres-projects/tPostgres,oberstet/postgres-xl,greenplum-db/gpdb,50wu/gpdb,arcivanov/postgres-xl,postmind-net/postgres-xl,50wu/gpdb,50wu/gpdb,kmjungersen/PostgresXL,greenplum-db/gpdb,greenplum-db/gpdb,tpostgres-projects/tPostgres,lisakowen/gpdb,Postgres-XL/Postgres-XL,Postgres-XL/Postgres-XL,ashwinstar/gpdb,adam8157/gpdb,xinzweb/gpdb,50wu/gpdb,arcivanov/postgres-xl