lib: fix memory leak in B-tree

When the depth of B-tree for sd_inode becomes 2, and last ext-node is full, there
is a memory leak in routine of search_whole_btree() -- we only free memory in
path->p_ext_header but its value will be NULL in this case.

Signed-off-by: Robin Dong <sanbai@taobao.com>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
lib: make depth of ext-node right

When depth of B-tree become 2, the value of 'depth' for ext-node
should be 1 (the 'depth' of idx-node is 2).

Signed-off-by: Robin Dong <sanbai@taobao.com>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
lib: write correct data of inode

To write 'btree_counter' back, we should give memory of 'inode->btree_counter'
to writer instead of 'inode'.

Signed-off-by: Robin Dong <sanbai@taobao.com>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>