A signal can enter in the middle of pshared_cahce_insert, which a key
is updated but not val is not updated. In this case the update of
these two fields are not atomic. If the signal call pshared lock. it
match the key but val is not updated.
To solve this, we first move the insertion into critical section. This
solves the thread itself and the signal handler inserting the key at
the same time.
For read, we add a sequence number as a guard on each key insertion to
make sure there is no write happens in the cache_lookup.
Reported by: llm-postcr