textbuffer: Fix pasting text
The memory stolen from a memory outputstream isn't guaranteed to be 0-terminated, so don't make that assumption.
Fixes: #4357 (closed)
The memory stolen from a memory outputstream isn't guaranteed to be 0-terminated, so don't make that assumption.
Fixes: #4357 (closed)