Fix RBM_ZERO_AND_LOCK mode to not acquire lock on local buffers.
Fix RBM_ZERO_AND_LOCK mode to not acquire lock on local buffers.

Commit 81c45081 introduced a new RBM_ZERO_AND_LOCK mode to ReadBuffer, which
takes a lock on the buffer before zeroing it. However, you cannot take a
lock on a local buffer, and you got a segfault instead. The version of that
patch committed to master included a check for !isLocalBuf, and therefore
didn't crash, but oddly I missed that in the back-patched versions. This
patch adds that check to the back-branches too.

RBM_ZERO_AND_LOCK mode is only used during WAL replay, and in hash indexes.
WAL replay only deals with shared buffers, so the only way to trigger the
bug is with a temporary hash index.

Reported by Artem Ignatyev, analysis by Tom Lane.

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