Fix signal handler

As reported on the issue, exit() is not a safe function for signals.
Replace with _exit().

Issue: #10