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.
Merge pull request #5963 from terminalmage/issue2922

Fix virtual package detection