Fix SIGINT handling

Previously, the process would lock up after printing stack traces.