Minor fixes in error cleanup while generating key files
Minor fixes in error cleanup while generating key files

* Do not restore umask if it was not set.
* If there’s an error |key| shouldn’t be used so no need to memset().

davidlamprea/candado