Summary:
This partially reverts commit 0e51069b56acc2768879c4408334801af99a422c / D44528.
D44528 over-zealously replaced the regex thread local changes with the `__thread_local` directive, but missed that the `re_array` cache uses memory allocation, so it requires special cleanup logic.
This change keeps the `__thread_local` changes for simple regex objects (basic structs, enums, integers), but keeps the pre-D44528 behaviour of defining C++ objects to store the regex cache in, so that the cleanup code can run on the destruction of the object.
D44528 landed after the 2025.1 branch cut, so no backport is required.
Jira: DB-17259
Test Plan:
```
./yb_build.sh asan --cxx-test pgwrapper_pg_mini-test --gtest_filter PgMiniTest.RegexPushdown --clang19
./yb_build.sh tsan --cxx-test pgwrapper_pg_mini-test --gtest_filter PgMiniTest.RegexPushdown --clang19
```
Reviewers: kfranz
Reviewed By: kfranz
Subscribers: jason, yql
Differential Revision: https://phorge.dev.yugabyte.com/D44803