Close the telnet socket after use
Add a timeout and some better error processing to the telnet support