Use sigaction instead of signal to setup handlers