core: Do not clobber R_KEY in gpgme_get_key on error.
* src/keylist.c (gpgme_get_key): Assign a value to the return parameter only on success.
This problem could be triggered by an ambiguous key. The problem is
that the key returned in that case is for one not expected and worse
it has not been ref-ed.
- Signed-off-by: Werner Koch <wk@gnupg.org>