Simplify the implementation of MMDB_get_tree

We don't need a loop and we always return the value of get_tree to the caller