Fix memory corruption in tree index during recovery from snapsht.

When tree.max_size is 0, tree.max_size * 2 is also 0.