(#19845) block confines

Allow confine to take a block parameter, like:

```ruby
confine { code... }
```

Builds on top of pull #408