Don't treat canceled key generation as success or error
(cherry picked from commit d58f0d77dbab85834c5f3e985f8fe6c4597495cd)