Fix relcache reference leak in refresh_by_match_merge().
Fix relcache reference leak in refresh_by_match_merge().

One path through the loop over indexes forgot to do index_close().  Rather
than adding a fourth call, restructure slightly so that there's only one.

In passing, get rid of an unnecessary syscache lookup: the pg_index struct
for the index is already available from its relcache entry.

Per report from YAMAMOTO Takashi, though this is a bit different from his
suggested patch.  This is new code in HEAD, so no need for back-patch.

Postgres-XL/Postgres-XL,greenplum-db/gpdb,50wu/gpdb,jmcatamney/gpdb,pavanvd/postgres-xl,lisakowen/gpdb,techdragon/Postgres-XL,ovr/postgres-xl,ovr/postgres-xl,yazun/postgres-xl,jmcatamney/gpdb,ashwinstar/gpdb,lisakowen/gpdb,greenplum-db/gpdb,yazun/postgres-xl,zeroae/postgres-xl,lisakowen/gpdb,xinzweb/gpdb,yazun/postgres-xl,ovr/postgres-xl,jmcatamney/gpdb,oberstet/postgres-xl,jmcatamney/gpdb,xinzweb/gpdb,adam8157/gpdb,greenplum-db/gpdb,yazun/postgres-xl,zeroae/postgres-xl,adam8157/gpdb,ovr/postgres-xl,zeroae/postgres-xl,techdragon/Postgres-XL,lisakowen/gpdb,50wu/gpdb,yazun/postgres-xl,greenplum-db/gpdb,pavanvd/postgres-xl,jmcatamney/gpdb,50wu/gpdb,greenplum-db/gpdb,Postgres-XL/Postgres-XL,techdragon/Postgres-XL,50wu/gpdb,50wu/gpdb,ashwinstar/gpdb,adam8157/gpdb,ashwinstar/gpdb,ovr/postgres-xl,lisakowen/gpdb,pavanvd/postgres-xl,xinzweb/gpdb,techdragon/Postgres-XL,ashwinstar/gpdb,oberstet/postgres-xl,zeroae/postgres-xl,adam8157/gpdb,ashwinstar/gpdb,lisakowen/gpdb,50wu/gpdb,Postgres-XL/Postgres-XL,greenplum-db/gpdb,jmcatamney/gpdb,ashwinstar/gpdb,oberstet/postgres-xl,pavanvd/postgres-xl,adam8157/gpdb,oberstet/postgres-xl,xinzweb/gpdb,xinzweb/gpdb,adam8157/gpdb,adam8157/gpdb,jmcatamney/gpdb,techdragon/Postgres-XL,50wu/gpdb,xinzweb/gpdb,ashwinstar/gpdb,adam8157/gpdb,Postgres-XL/Postgres-XL,50wu/gpdb,xinzweb/gpdb,greenplum-db/gpdb,pavanvd/postgres-xl,jmcatamney/gpdb,greenplum-db/gpdb,oberstet/postgres-xl,xinzweb/gpdb,lisakowen/gpdb,ashwinstar/gpdb,Postgres-XL/Postgres-XL,lisakowen/gpdb,zeroae/postgres-xl