Add multiple pkg support to pkg.latest (pacman)

Also tweaked the changes made to the pkg state in 306cc74, and fixed a
logic bug I introduced into apt.py in the same commit.