Modules: preserve shared dict entries on failed updates
Shared dictionary updates temporarily remove timeout entries from the
expiration rbtree to prevent eviction while allocating a replacement.
ngx_rbtree_delete() clears the removed node key, so the failure path
reinserted the entry with a zero expiration and made its old value appear
expired.
Factor the shared-memory update into an engine-independent helper and
restore the previous expiration when allocation fails. Keep value
conversion in the njs and QuickJS wrappers.