Fix virtual package detection

This was inadvertently broken in 806342d when apt.py was changed to
allow for the detection of partially-installed packages. This commit
fixes #2922, which was re-opened this morning.