fix(declarative) fix race condition when reloading config by making sure the correct config page is purged during load
fix(declarative) fix race condition when reloading config by making sure
the correct config page is purged during load

The issue is only present when Kong is running with multiple workers.
Use #5789 as an example, the following events happens:

1. A new declarative config is uploaded via the Admin API
2. Kong is on cache page 2, `kong.core_cache:purge()` is called without
the shadow flag, causes the page `1` to be purged immediately
3. New config is loaded into page 1
4. Kong switches to use page 1, then page 2 is purged immediately.
The switch to use page 1 is not immediate and some
workers may keep using the now empty page 2 for a short period of time. This may cause
page 2 to be poisoned with an incorrect negative match. Which for #5789,
is the `sni:example.com` for looking up certificate matches. This
will cause `sni:example.com` to forever return `false` when next time switch
to page 2 happens.

This commit fixes the semantics of atomic page switching. With this
commit the issue described inside #5789 no longer happens, and that
the race window that Kong presents the default certificate between page
flips because page 1 is sometimes purged prematurely while in use no longer happens.

fixes #5789

Kong/kong,Kong/kong,Kong/kong