fix(db) cassandra paging issue race condition between lightreads (#5564)
fix(db) cassandra paging issue race condition between lightreads (#5564)

### Summary

Some time Kong is returning 404 even though the routes are valid and registered.
We have found that it is due to the wrong paging_state sent by Kong to Cassandra.
Due to the partition handling logic in Cassandra, it is returning success response
with 0 rows for routes table (because route table has a partition key). The same
behavior can also be observed in plugins rebuild as well because the plugin table
doesn't have partition key so it is getting null pointer exception from Cassandra.

In case of null pointer exception for plugin rebuild, Kong is considering it as a
failed case and reusing the old cache but in case of routes rebuild as Kong is
getting success response from Cassandra, Kong is updating the cache with
empty data.


After looking at the code of select each method, we have observerd that
kong/db/strategies/cassandra/init.lua page method is sharing opts variable
on thread level. In Kong to when we use router_consistency as eventual,
we saw that we are using ngx.semaphore to create two different light threads
to rebuild routes and plugins at the same time (only when routes and plugins
are updated at the same time),  these light threads are not using the same
opts variable to store page_state, due to race condition the page_state stored
in opts can get overridden by other light thread.

We have observed that some times routes page state is being used by plugin
query and plugin page state is being used by route query which is causing
unexpected behavior (404 in some cases).

#### Steps to reproduce

- Start Kong with 16 worker threads
- Create more than 1000 routes and plugins
- Set router_consistency to eventual
- Modify a plugin and a route at the same time (it is very hard to change at
  same time, please  consider using router_update_frequency to 10 secs and
  also change the plugin update frequency to 10 secs as well)
- Print the cached router length, there should be some page missing entirely
  on the length of routes and also some null pointer exceptions can be
  observed on the plugin rebuild.

### Full changelog

* reducing the scope of the opts variable from thread level to light thread level

### Issues resolved

Fix #4769 , #5374 
Kong/kong,Kong/kong,Kong/kong