unpack-trees: propagate errors adding entries to the index