Add write cache
DB: fix memory leak
Add assertion
Test: update btreemap concurrent test