Add support for resetting signal masks

By default, child process will inherit signal masks (blocked signals)
from its parent process.  Once the signal is blocked, the child process
will not be able to receive notifications for those signals.

Some parent processes (such as system daemons implemented using
brillo::Daemon) will block signals such as SIGTERM and SIGINT, so that
they can use signalfd to monitor those signals instead.  In this case,
the child process will not be able to receive notification for these
signals.

To fix it, allow the caller to specify a flag to indicate if child
process should reset the signal mask or not.

Bug: None
BUG=chrome-os-partner:47785
TEST=Manual test

Change-Id: I7d32c50e67af0dadbfeca8316f85b9a542e952c0
2 files changed