telnet: fix a couple of snprintf() buffer overflows
Obtained from: Juniper Networks MFC after: 1 week