Fix bad message parsing in CMake server
If a partial message is flushed into the input pipe for CMake Server, the parser will try and parse it as a full message because of some bad loop checks.
Found this problem with my extension because I send the message in three separate calls: The magic header, the body, and the magic footer. CMake tries to parse JSON immediately after I send the magic header, and the connection barfs.
This bug is present only in the 3.10.0 RC. Maybe want to get this merged into 3.10? I can kind of work around the problem if I send the whole message in a single call, but it's not guaranteed that I won't randomly hit a buffer boundary and the connection will barf again.