Fix SIGSEGV issue when freeing gangs
Fix SIGSEGV issue when freeing gangs

Previously, to avoid the leak of the gang if someone terminates
the query in the middle of gang creation, we added a global pointer
named CurrentGangCreating so the partially created gang can also be
destroyed at the end of the transaction. However, the memory context
named GangContext where CurrentGangCreating was created may be reset
before CurrentGangCreating is actually destroyed and a SIGSEGV may
occur. So this commit makes sure that CurrentGangCreating is destroyed
ahead of other created gangs and the reset of GangContext.

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