agent: Terminate pinentry process gracefully, by watching socket.
* agent/call-pinentry.c (watch_sock): New. (do_getpin): Spawn the watching thread.
While we don't have npth_cancel (and it's difficult to implement it
correctly), this is a kind of best compromise allowing a thread's
polling when pinentry is active.
- GnuPG-bug-id: T2011
- Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>