Backpatch certain files through 9.0
We have other general-purpose data structures in src/backend/lib, so it seems like a better home for the red-black tree as well.