Python 3 doesn't use C `stdio' streams. In order to integrate properly,
we need to provide some other way to do I/O of key material. Introduce
new functions which work in terms of lines in the keyring, which a
Python wrapper can transfer between us and a Python file.