Make sure to return correct error codes for secmem failures.
ERRNO was not always set and thus it could happen that a misleading
error code was returned form a malloc functions. Fix was to set
ERRNO.
At one place we also switched to the newer gpg_err_code_from_syserror
which makes sure to return a special error code in case ERRNO is not
set at all.