Stop dropping data in rewrite

If an incomplete line has been written, we will read it out of the
buffer - not process it, as it's not a complete line, and then rebuild
the buffer without it.  This basically means than we can throw away
everything but the line ending, depending on how data arrives.  So,
now we rebuild the buffer _including_ the data that we have read, but
not processed.