This isn't quite what I had in mind.  What I suggested (but I realize I didn't convey it all that clearly) is that the initial call to sigaction(), the one that installs SignalExit as the handler, sets the SA_RESETHAND flag.