Author: Xiang Xiao <xiaoxiang@xiaomi.com>
Check POLLHUP and POLLERR in telnet poll loop
to handle the remote end close correctly
Send "NVT"(network virtual terminal) as the default if getenv("TERM") return NULL
telnet should trigger the error handling if inet_pton return zero
since zero mean the string has format error
Don't return 1 in _environ_telnet to avoid trigger the compression
and remove the redundant TELNET_TELOPT_COMPRESS2 check
Change telnet_error_u to telnet_error_e required by the coding standard
Ensure telnet object get freed before the abnormal exit