Fix reading outside buffer bug in TcpClient