Fix recurring crash of glogger
When decoding broken encodings, we add a \
to ensure the resulting sequence is valid JSON.
This might make the resulting line longer than the original, and we need to properly allocate memory in that case.
Bug: T363342