Fix case where line is larger than maxline and writer ended up in an infinite loop trying to buffer more data. Change-Id: I243da738b331279d6bf27255778b5798e7f37f95