configure: use pkg-config with newer gpgme and gpg-error
This tweaks autoconf logic in order to use pkg-config for gpgme
and gpg-error when available.
Recent versions of gpgme directly provide threaded support, and
gpg-error started shipping a .pc file. Thus on recent distributions
it is possible to directly use pkg-config for both. On older
environments, the legacy logic is kept in place.
Forwarded: https://github.com/ostreedev/ostree/pull/2789
Gbp-Pq: Name configure-use-pkg-config-with-newer-gpgme-and-gpg-error.patch