store bindings now in an array for safe, fast iteration (#48212)
This lets us query and iterate the bindings without needing to hold
locks over the queries, making those operations more scalable and safe
to use across safepoints or concurrently. It is similar to how we
already deal with specializations and datatype caches.
Updates the smallintcache to additionally be more threadsafe for users,
with explicit acquire and release operations.