Fix an invalid free in _serialize

If serialization isn't on, and you call _serialize with a string,
the string is not copied at all, so we don't need to STR_FREE it