agent: Terminate pinentry process gracefully, by watching socket.