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.