tests/openpgp: Reimplement 'pinentry.sh' in c.