Use block to trap INT instead of trap.

`Signal::trap` is global, so using a block ensures that the signal is only trapped at the point we need the behavior.