Fix an off-by-one error. This should fix bug 3161. The problem was that the code checked whether the data would fit the allocated space, and if it didn't, it would allocate more.  So far so good.  But if the data fits exactly, the code would then copy one too few characters.  We now extend the buffer if the data fits exactly. Note that fitting exactly is here defined as fits without the usual NUL byte at the end of the string, so we needed to extend for that anyway. This only showed up on Windows because BUFSIZ is significantly smaller on Windows than on Linux.
Fix an off-by-one error.
This should fix bug 3161.
The problem was that the code checked whether the data would fit the
allocated space, and if it didn't, it would allocate more.  So far so
good.  But if the data fits exactly, the code would then copy one too
few characters.  We now extend the buffer if the data fits exactly.
Note that fitting exactly is here defined as fits without the usual
NUL byte at the end of the string, so we needed to extend for that
anyway.
This only showed up on Windows because BUFSIZ is significantly smaller
on Windows than on Linux.

zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb