tree_node: fix bug where child was not removed from underlying array