Fix ADHI-4102 handle SIGINT and SIGTERM cleanly