Refactor PLWriter in preparation for buffered-document change.
Currently, PLWriter (Position List Writer) creates a locally-owned
DataBuffer to write into. This is necessary to support doclist
collection during tokenization, where there is no obvious buffer to
write output to, but is not necessary for the other users of PLWriter.
This change adds a DLCollector (Doc List Collector) structure to
handle the tokenization case.
Also fix a potential memory leak in writeZeroSegment(). In case of
error from leafWriterStep(), the DataBuffer dl was being leaked. (CVS 3706)
FossilOrigin-Name:
1b9918e20767aebc9c1e7523027139e5fbc12688