fix bug in available_version

Thanks to @kfdm for finding this. This commit fixes a problem with
available_version where it does not return information for packages
which are not already installed.
Merge pull request #3533 from archtaku/quickfix

fix bug in available_version