checkout --to: fix dangling pointers in remove_junk()