Serialize Go data with cyclic pointers