Fix a rare race condition when commit_siblings > 0 and a transaction commits at the same instant as a new backend is spawned. Since CountActiveBackends() doesn't hold ProcArrayLock, it needs to be prepared for the case that a pointer at the end of the proc array is still NULL even though numProcs says it should be valid, since it doesn't hold ProcArrayLock. Backpatch to 8.1. 8.0 and earlier had this right, but it was broken in the split of PGPROC and sinval shared memory arrays.
Fix a rare race condition when commit_siblings > 0 and a transaction commits
at the same instant as a new backend is spawned. Since CountActiveBackends()
doesn't hold ProcArrayLock, it needs to be prepared for the case that a
pointer at the end of the proc array is still NULL even though numProcs says
it should be valid, since it doesn't hold ProcArrayLock. Backpatch to 8.1.
8.0 and earlier had this right, but it was broken in the split of PGPROC and
sinval shared memory arrays.

Per report and proposal by Marko Kreen.

cjcjameson/gpdb,rvs/gpdb,lisakowen/gpdb,cjcjameson/gpdb,xinzweb/gpdb,kaknikhil/gpdb,ashwinstar/gpdb,Chibin/gpdb,greenplum-db/gpdb,rvs/gpdb,kaknikhil/gpdb,ashwinstar/gpdb,yuanzhao/gpdb,xinzweb/gpdb,yuanzhao/gpdb,yuanzhao/gpdb,ahachete/gpdb,greenplum-db/gpdb,jmcatamney/gpdb,0x0FFF/gpdb,royc1/gpdb,jmcatamney/gpdb,Quikling/gpdb,royc1/gpdb,yuanzhao/gpdb,edespino/gpdb,jmcatamney/gpdb,zaksoup/gpdb,zaksoup/gpdb,50wu/gpdb,ashwinstar/gpdb,chrishajas/gpdb,kaknikhil/gpdb,0x0FFF/gpdb,xinzweb/gpdb,50wu/gpdb,greenplum-db/gpdb,ashwinstar/gpdb,janebeckman/gpdb,greenplum-db/gpdb,rvs/gpdb,jmcatamney/gpdb,cjcjameson/gpdb,jmcatamney/gpdb,yuanzhao/gpdb,lintzc/gpdb,lisakowen/gpdb,edespino/gpdb,lintzc/gpdb,50wu/gpdb,yuanzhao/gpdb,ashwinstar/gpdb,jmcatamney/gpdb,edespino/gpdb,kaknikhil/gpdb,cjcjameson/gpdb,xinzweb/gpdb,Quikling/gpdb,Chibin/gpdb,ahachete/gpdb,kaknikhil/gpdb,janebeckman/gpdb,adam8157/gpdb,lisakowen/gpdb,Quikling/gpdb,rvs/gpdb,lisakowen/gpdb,royc1/gpdb,0x0FFF/gpdb,lintzc/gpdb,lisakowen/gpdb,edespino/gpdb,lisakowen/gpdb,lisakowen/gpdb,Chibin/gpdb,ashwinstar/gpdb,lintzc/gpdb,zaksoup/gpdb,50wu/gpdb,xinzweb/gpdb,lisakowen/gpdb,royc1/gpdb,ahachete/gpdb,royc1/gpdb,cjcjameson/gpdb,chrishajas/gpdb,0x0FFF/gpdb,Chibin/gpdb,xuegang/gpdb,xuegang/gpdb,greenplum-db/gpdb,janebeckman/gpdb,janebeckman/gpdb,lintzc/gpdb,Chibin/gpdb,kaknikhil/gpdb,cjcjameson/gpdb,50wu/gpdb,royc1/gpdb,xuegang/gpdb,ashwinstar/gpdb,cjcjameson/gpdb,xuegang/gpdb,CraigHarris/gpdb,chrishajas/gpdb,Quikling/gpdb,yuanzhao/gpdb,ahachete/gpdb,ahachete/gpdb,chrishajas/gpdb,edespino/gpdb,CraigHarris/gpdb,CraigHarris/gpdb,kaknikhil/gpdb,CraigHarris/gpdb,xuegang/gpdb,Quikling/gpdb,janebeckman/gpdb,xinzweb/gpdb,kaknikhil/gpdb,rvs/gpdb,kaknikhil/gpdb,ahachete/gpdb,Chibin/gpdb,kaknikhil/gpdb,Quikling/gpdb,jmcatamney/gpdb,0x0FFF/gpdb,chrishajas/gpdb,lintzc/gpdb,xuegang/gpdb,yuanzhao/gpdb,Quikling/gpdb,Quikling/gpdb,cjcjameson/gpdb,adam8157/gpdb,Chibin/gpdb,xuegang/gpdb,ahachete/gpdb,adam8157/gpdb,Chibin/gpdb,xuegang/gpdb,cjcjameson/gpdb,rvs/gpdb,lintzc/gpdb,0x0FFF/gpdb,50wu/gpdb,edespino/gpdb,ashwinstar/gpdb,rvs/gpdb,edespino/gpdb,edespino/gpdb,rvs/gpdb,xuegang/gpdb,cjcjameson/gpdb,royc1/gpdb,CraigHarris/gpdb,xinzweb/gpdb,zaksoup/gpdb,zaksoup/gpdb,greenplum-db/gpdb,janebeckman/gpdb,yuanzhao/gpdb,ahachete/gpdb,Quikling/gpdb,adam8157/gpdb,yuanzhao/gpdb,0x0FFF/gpdb,lintzc/gpdb,zaksoup/gpdb,edespino/gpdb,adam8157/gpdb,chrishajas/gpdb,chrishajas/gpdb,0x0FFF/gpdb,CraigHarris/gpdb,lintzc/gpdb,janebeckman/gpdb,50wu/gpdb,zaksoup/gpdb,rvs/gpdb,xinzweb/gpdb,edespino/gpdb,greenplum-db/gpdb,janebeckman/gpdb,adam8157/gpdb,Chibin/gpdb,adam8157/gpdb,Chibin/gpdb,zaksoup/gpdb,50wu/gpdb,rvs/gpdb,janebeckman/gpdb,chrishajas/gpdb,royc1/gpdb,CraigHarris/gpdb,greenplum-db/gpdb,CraigHarris/gpdb,CraigHarris/gpdb,janebeckman/gpdb,jmcatamney/gpdb,Quikling/gpdb,adam8157/gpdb