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.
Reading from stdin uses util_getpass, which defines MAX_PASS_SIZE and thus imposes the limit.