assuan: Reorganize waiting for socket.
* common/asshelp.c (wait_for_sock): New function, collecting codepaths from... (start_new_gpg_agent) here and... (start_new_dirmngr) here.
This has no functional change, but makes it easier to make this
function more efficient.
(cherry picked from commit 0471ff9d3bf8d6b9a359f3c426d70d0935066907)
- GnuPG-bug-id: T3490
- Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>