world: fix crash with entities removed during update loop