Fix memory leak in GIN index scans.
Fix memory leak in GIN index scans.

The code had a query-lifespan memory leak when encountering GIN entries
that have posting lists (rather than posting trees, ie, there are a
relatively small number of heap tuples containing this index key value).
With a suitable data distribution this could add up to a lot of leakage.
Problem seems to have been introduced by commit 36a35c550, so back-patch
to 9.4.

Julien Rouhaud

adam8157/gpdb,greenplum-db/gpdb,adam8157/gpdb,lisakowen/gpdb,xinzweb/gpdb,50wu/gpdb,jmcatamney/gpdb,adam8157/gpdb,lisakowen/gpdb,lisakowen/gpdb,50wu/gpdb,greenplum-db/gpdb,xinzweb/gpdb,ashwinstar/gpdb,adam8157/gpdb,ashwinstar/gpdb,jmcatamney/gpdb,adam8157/gpdb,lisakowen/gpdb,xinzweb/gpdb,ashwinstar/gpdb,jmcatamney/gpdb,50wu/gpdb,xinzweb/gpdb,lisakowen/gpdb,jmcatamney/gpdb,adam8157/gpdb,ashwinstar/gpdb,ashwinstar/gpdb,greenplum-db/gpdb,jmcatamney/gpdb,greenplum-db/gpdb,xinzweb/gpdb,greenplum-db/gpdb,jmcatamney/gpdb,greenplum-db/gpdb,ashwinstar/gpdb,greenplum-db/gpdb,xinzweb/gpdb,50wu/gpdb,jmcatamney/gpdb,greenplum-db/gpdb,adam8157/gpdb,adam8157/gpdb,lisakowen/gpdb,lisakowen/gpdb,50wu/gpdb,xinzweb/gpdb,50wu/gpdb,lisakowen/gpdb,ashwinstar/gpdb,50wu/gpdb,xinzweb/gpdb,ashwinstar/gpdb,50wu/gpdb,jmcatamney/gpdb