(do_cleanup): Test for invalid signal mask to decide whether to restore the mask rather than assuming zero mask indicates that there is nothing to do.
(do_cleanup): Test for invalid signal mask to decide whether to restore the mask rather than assuming zero mask indicates that there is nothing to do.