Use incrementors for cache invalidation in get_terms().

fixes #23326
see #23173
In wp_get_archives(), cache queries to individual cache buckets instead of storing them in one cached array. Use incrementor style passive cache invalidation.

fixes #23206
see #23173