gpg: Fix a memory leak in batch key generation