tools: Add util_get_pin helper function

Using this helper PINs can be passed via the command line, stdin and
an environment variable.
For now only used in the openpgp tool.
(new) behaviour should be documented