Fix pkg.latest regression

This commit fixes a regression in which the pkg.latest state fails if
there is no new version of a package, even if the currently-installed
version matches the newest in the repositories.