dirmngr: Cleanup zombies and fix hang on shutdown.
* dirmngr/ldap-wrapper.c (ldap_wrapper_thread): Move nfds computation into the loop. Check the queue also on timeout. Close log_fd and reader context on EOF or error.
The major bug here was that on an EOF of the log fd the log fd was not
closed and thus the final queue item removal could not work. Checking
the queue on a timeout is not really necessary but it help in case
there is a race condition lingering.