Catch SIGTERM for graceful shutdown