KeyValueStore: Fix scrub causing inconsistence state

Fix #8589
Backport #Firefly
Signed-off-by: Haomai Wang <haomaiwang@gmail.com>