Fix issue #1713: Adding fallback for SIGTERM