sigaction error checking

Added error checking to all uses of sigaction().