improve Bodhi2Client.query compat for old client
improve Bodhi2Client.query compat for old client

This basically fixes 'bodhi -D' with the 'old' CLI client (the
one we still ship). bodhi -D is typically used like this:

bodhi -D fedfind-1.6-1.el6
bodhi -D FEDORA-EPEL-2015-8157

neither of these worked. The client submits the term as
'package'; Bodhi2Client was simply converting it to 'packages'.
But 'packages' expects bare package name(s), not NEVRs or
update IDs. The old API would try the 'update' argument as an
update ID, then if that didn't work try it as a package name,
then if *that* didn't work try it as a NEVR - see:
https://github.com/fedora-infra/bodhi/blob/bodhi1-develop/bodhi/controllers.py#L358
So we try and replicate that here, only by using regexes
instead of by running three queries.

There are three other necessary fixes also. The 'type_' arg has
to be converted to 'type' here too, and we have to convert the
'bugs' argument to None if it's an empty string, because of how
the API query_updates() method works (it does 'if bugs is not
None' rather than 'if not bugs'). Handling of 'mine' is also
corrected: it will be 'in' kwargs even if it's set to False, so
we instead need to check whether it's there *and the value is
truth-y*.

fedora-infra/python-fedora