Fix reading CachedString from a stream

At least with clang/libc++, std::stringstream() << stream.rdbuf()
doesn't terminate reading from streambuf neither on end of token
nor on end of buf, reading past the end of buffer and leading to
segfault. Just reading a token into a string seem to simplier and
more reliable.