generate tty_keys.h from xterm itself

Script gen_tty_keys.sh is heavily based on the script escapes.sh by Egmont
Koblinger.

Closes T1564