core: For consistency, ensure that read lines are NUL terminated on any error, not only on buffer full. trunk patch: http://svn.apache.org/r1824303 +1: ylavic, rpluem, minfrin