Refactored storage

- [done]fix unit test
- [done]run flare-tests with kch/tcb
The logic of the lock position might be changed.
The unlock of mutex slots were called before tchdbecode() was called.