scala.tools.util.SignalManager.rSignal
It's hard to believe there's no way to get a signal's current handler without replacing it, but if there is I couldn't find it, so we have this swapping code.