fixed rbtree_walk() to return the correct count of visited nodes

+ added tests to check the return value from both rbtree_walk()
  and rbtree_walk_sorted()