Fixed a portable serialization data race bug.