Fix two more bugs in fast-path relation locking.
Fix two more bugs in fast-path relation locking.

First, the previous code failed to account for the fact that, during Hot
Standby operation, the startup process takes AccessExclusiveLocks on
relations without setting MyDatabaseId.  This resulted in fast path
strong lock counts failing to be incremented with the startup process
took locks, which in turn allowed conflicting lock requests to succeed
when they should not have.  Report by Erik Rijkers, diagnosis by Heikki
Linnakangas.

Second, LockReleaseAll() failed to honor the allLocks and lockmethodid
restrictions with respect to fast-path locks.  It's not clear to me
whether this produces any user-visible breakage at the moment, but it's
certainly wrong.  Rearrange order of operations in LockReleaseAll to fix.
Noted by Tom Lane.

ashwinstar/gpdb,tpostgres-projects/tPostgres,50wu/gpdb,50wu/gpdb,greenplum-db/gpdb,Postgres-XL/Postgres-XL,postmind-net/postgres-xl,kmjungersen/PostgresXL,techdragon/Postgres-XL,xinzweb/gpdb,kmjungersen/PostgresXL,zeroae/postgres-xl,lisakowen/gpdb,greenplum-db/gpdb,kmjungersen/PostgresXL,greenplum-db/gpdb,lisakowen/gpdb,ovr/postgres-xl,adam8157/gpdb,xinzweb/gpdb,oberstet/postgres-xl,jmcatamney/gpdb,techdragon/Postgres-XL,greenplum-db/gpdb,ashwinstar/gpdb,arcivanov/postgres-xl,lisakowen/gpdb,ashwinstar/gpdb,greenplum-db/gpdb,adam8157/gpdb,snaga/postgres-xl,Postgres-XL/Postgres-XL,arcivanov/postgres-xl,ovr/postgres-xl,xinzweb/gpdb,ashwinstar/gpdb,jmcatamney/gpdb,oberstet/postgres-xl,pavanvd/postgres-xl,ovr/postgres-xl,tpostgres-projects/tPostgres,50wu/gpdb,yazun/postgres-xl,yazun/postgres-xl,xinzweb/gpdb,lisakowen/gpdb,Postgres-XL/Postgres-XL,xinzweb/gpdb,kmjungersen/PostgresXL,tpostgres-projects/tPostgres,zeroae/postgres-xl,techdragon/Postgres-XL,50wu/gpdb,jmcatamney/gpdb,yazun/postgres-xl,arcivanov/postgres-xl,jmcatamney/gpdb,pavanvd/postgres-xl,xinzweb/gpdb,snaga/postgres-xl,snaga/postgres-xl,postmind-net/postgres-xl,lisakowen/gpdb,pavanvd/postgres-xl,ashwinstar/gpdb,oberstet/postgres-xl,adam8157/gpdb,jmcatamney/gpdb,ovr/postgres-xl,ashwinstar/gpdb,greenplum-db/gpdb,ashwinstar/gpdb,xinzweb/gpdb,xinzweb/gpdb,tpostgres-projects/tPostgres,50wu/gpdb,oberstet/postgres-xl,adam8157/gpdb,zeroae/postgres-xl,yazun/postgres-xl,kmjungersen/PostgresXL,lisakowen/gpdb,adam8157/gpdb,Postgres-XL/Postgres-XL,jmcatamney/gpdb,50wu/gpdb,lisakowen/gpdb,arcivanov/postgres-xl,postmind-net/postgres-xl,adam8157/gpdb,ovr/postgres-xl,zeroae/postgres-xl,50wu/gpdb,yazun/postgres-xl,greenplum-db/gpdb,50wu/gpdb,lisakowen/gpdb,postmind-net/postgres-xl,ashwinstar/gpdb,arcivanov/postgres-xl,snaga/postgres-xl,postmind-net/postgres-xl,zeroae/postgres-xl,jmcatamney/gpdb,Postgres-XL/Postgres-XL,tpostgres-projects/tPostgres,techdragon/Postgres-XL,pavanvd/postgres-xl,snaga/postgres-xl,oberstet/postgres-xl,adam8157/gpdb,techdragon/Postgres-XL,adam8157/gpdb,greenplum-db/gpdb,arcivanov/postgres-xl,pavanvd/postgres-xl,jmcatamney/gpdb