Add a signal handler to pause.

It returns 0 when a signal is received.
Merge pull request #1563 from vmarmol/master

Add a signal handler to pause.