keyring: support python-keyring 3+

Based on: patch for Debian #728468 by Sebastian Ramacher