Fix quadratic LWLock wait queue behaviour

When Who What
2022-11-21 23:07:33 Andres Freund (andresfreund) Closed in commitfest 2022-11 with status: Committed
2022-11-21 23:07:33 Andres Freund (andresfreund) Changed committer to andresfreund
2022-11-01 11:07:15 Bharath Rupireddy (bharathrupireddy) Added bharathrupireddy as reviewer
2022-11-01 01:11:25 Andres Freund (andresfreund) Changed authors to Andres Freund (andresfreund)
2022-11-01 01:11:13 Andres Freund (andresfreund) Attached mail thread 20221027165914.2hofzp4cvutj6gin@awork3.anarazel.de
2022-11-01 01:11:13 Andres Freund (andresfreund) Created patch record