Use gpg_err_set_errno to assign values to ERRNO.