fix error handling for pthread_sigmask