Correctly NULL-terminate the JSON buffer in all cases.
Correctly NULL-terminate the JSON buffer in all cases.

When finalizing the JSON buffer, always NULL-terminate it at the
appropriate length.

Signed-off-by: Gergely Nagy <6780fac3b38619ac20422286e4110a70dbba2203@balabit.hu>

deirf/libumberlog