gpg: Fix format_keyid when dynamically allocating the buffer.