Ensure signal-safety of signal handlers