Handle SIGTERM event by closing app gracefully to prevent app crash on heroku free plan idle