KEYS: Fix stale key registration at error path (bnc#908163).