Fix use-after-free

This caused an invocation like 'pkgfile -l somerepo/pkg' to exit
zero even if pkg isn't in somerepo.