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.
Fix traceback in publish module

This fixes #5959 by re-casting the timeout value so that it is of the
proper type to be passed to time.sleep. Salt CLI args are loaded as
strings, which time.sleep does not like.