Fix rare core dump in BackendIdGetTransactionIds().
Fix rare core dump in BackendIdGetTransactionIds().

BackendIdGetTransactionIds() neglected the possibility that the PROC
pointer in a ProcState array entry is null.  In current usage, this could
only crash if the other backend had exited since pgstat_read_current_status
saw it as active, which is a pretty narrow window.  But it's reachable in
the field, per bug #12918 from Vladimir Borodin.

Back-patch to 9.4 where the faulty code was introduced.

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