[Nc-Core] Improved SocketTcp class.
Now we close sockets after a read or write if the pipe is broken/closed.