exit gracefully on sigterm