ITS#7968: add locking into syncrepl.

Mutex must be held even for a read-access of a cookie state,
as there may be a race with write in other thread.
syncrepl: ANY-logging for delete-ops.
syncrepl: ANY-logging for REFRESH.
lmdb: refine lifo freelist_save().