fix compiler warning
changed signal handling to consider sigaction

Specifically we must always use sa_sigaction and
then when chaining to the original signal handler
we must determine if it is a sa_sigaction or a
sa_handler type function and call it accordingly.