Clean up linebuf, and skip over any sequence of \r and \n