Simplify search tree with traversal helper.

The new form also makes GCC output a conditional move for selecting
between the left and right pointers. Might improve performance vs. a
conditional branch since the selection is unpredictable in general.