Keep serialization reference in xref entry while write is pending.
Use in-memory serialization reference to retrieve objects while write
is pending and clear serialization buffer when write is complete.
Also rename file.AddObjectxxx() methods to file.WriteObjectxxx().