[esp8266] enforce tcp connection state on various esp8266 functions