unpack-trees: don't shadow global var the_index