Add missing null terminator after realloc (buffer resize)