Reimplement ProcArrayLock as a new type of FlexLock.
By providing some custom handling for ProcArrayEndTransaction, we can
avoid the need for ending transactions to repeatedly acquire the
spinlock. The amount of work that needs to be done while holding the
lock is so small that we can do it while holding the spinlock, or
(when the lock is contended) make the last person to release the lock
do it on behalf of the ending backend. This greatly improves
performance for unlogged tables at high client counts; permanent
tables also benefit, but performance is still severely throttled by
WALInsertLock contention.