Serialize the table. When copy is true the backing entities buffer is
detached (sliced) so the snapshot survives later mutation of the live
table; otherwise the snapshot references the live buffer (faster, but only
valid until the next mutation).
Wipe all entity records. O(1). Next allocate starts from entity 0 again.