rbtree: fix memory leak in tests