This takes a closure that will be enqueued as an effect to ensure there are no entities on the stack.