Improved extraction of telnet codes from the input stream

A little crude, but better than swallowing telnet codes that happen
to overlap with ASCII characters