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.

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