Store key ring origin to database, related to #671

This will not (yet) set the key_ring_origin once the key is used for encryption (as supposed in #671)