Correctly create the register contexts in RegisterContextThreadMemory.