slave: no need to restore signal handlers; they are automatically
restored as long as they are not SIG_IGN (which they never are in
foot).
spawn(): restore signal mask after fork. This fixes an issue where a
terminal spawned with ctrl+shift+n did not terminate when its shell
exited.
Closes#366
When calling ‘reaper_add()’, the caller can provide a callback. If
non-NULL, the reaper will call the callback to handle the actual
reaping.
If the callback is NULL, or if it returns false, the reaper reaps the
child process.