core: Fix use-after-free issue in test
* tests/gpg/t-edit-sign.c (sign_key, verify_key_signature): New. (main): Factored out signing and verifying the result.
Factoring the two steps of the test into different functions fixes the
use-after-free issue that was caused by accidentaly using a variable
of the first step in the second step.
- GnuPG-bug-id: T5509