I've tried to reproduce problems around this (when I wrote this), but it's really hard to construct cases that need more than 8 pins. I've tested performance for those cases by simply not using the array, and while the performance suffers a bit, it's not that bad.
AFAIR this was suggested before and got rejected because constructing that worst case and proving that the approach does not perform too badly was a challenge. Having said that, I agree its time to avoid that memory allocation, especially with large number of backends running with large shared buffers.
An orthogonal issue I noted is that we never check for overflow in the ref count itself. While I understand overflowing int32 counter will take a large number of pins on the same buffer, it can still happen in the worst case, no ? Or is there a theoretical limit on the number of pins on the same buffer by a single backend ?