core: Support GPGME_AUDITLOG_DIAG for gpgsm.
core: Support GPGME_AUDITLOG_DIAG for gpgsm.

* src/engine-gpgsm.c (struct engine_gpgsm): Add fields diag_cb and
diagnostics.
(close_notify_handler): Close the diag fd on status fd close.
Handle diag close.
(gpgsm_cancel): Handle diag.
(gpgsm_release): Free DIAGNOSTICS.
(gpgsm_new): Support the diag feature.
(start): Set a handler for the diag fd.
(gpgsm_getauditlog): Support GPGME_AUDITLOG_DIAG.
--

Co-authored-by: Andre Heinecke <31e23f92c0c4498bda15e433d4fc5936c0d6e75c@gnupg.org>
Signed-off-by: Werner Koch <13bd1fc5137f503b0a8355ad400e7a87ebb45b25@gnupg.org>

gpg/gpgme,gpg/gpgme,gpg/gpgme,gpg/gpgme,gpg/gpgme,gpg/gpgme,gpg/gpgme