marshal: serialization may return 0 and target untouched

If serialization finds a structure already serialized, it skips it and
return 0. `target` should not be freed.