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.
- GnuPG-bug-id: T3490
- Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>