better error handling for broken gpg-agent connections