Make pkg.installed state multiple-version aware

This commit uses the "versions_as_list" kwarg that was recently added,
so that version specification works as expected for instances where more
than one version of a package is installed.

This fixes #2783.
Merge pull request #4419 from terminalmage/issue2783

Make pkg.installed state multiple-version aware