AllocateObject: Move GetClass at beginning to be sure SizeOf will work (otherwise ObjectType might still be opaque).