new helpers: {clear,test,test_and_clear}_restore_sigmask()