trees: cleanup preorder traversal non-recursive