core: Check for GPG_TTY as well as DISPLAY.