Catch SIGTERM in signal handler