Fix accessing entities flagged for removal during contact callback event handling