Move reference queue polling from cleanUp to its own method, to make it easier to inline the cleanUp() fast path.
Use a PhantomReference to finalize TransientNativeMemory, so the MemoryIO instance is guaranteed to be finalized and unreachable.