Add internal buffering for socket_stream

PingpongTest pass
LineByLineTest pass