Modify update atomic

Simplify the serialization functions by moving the handling of newly allocated structures into their callers, using atomic swaps.