Check clientSocket before calling close()
TelnetParser removes end of record command
Add new unit test for TerminalEmulator