Improved telnet timeout handling.