[alias-server] Handle SIGTERM and SIGINT events for graceful app shutdown
Summary:
This should have been handled earlier. Has come to light in optimizing how pendingAliases are handled by the app.
Best way to handle pendingAliases with the database involves using caching...so, might as well just use caching to handle the pendingAliases...but good caching solutions (e.g. redis) need to be started and stopped appropriately by the app. This logic isn't in place yet even though it should be for the server and the db.
Add it in anticipation of adding caching.
Test Plan:
npm test
node index.js and then ctrl+c, observe shutdown output
node index.js and then, in a separate terminal, ps a -A | grep node, find pid for node index.js, then kill <pid>, observe same output
Reviewers: #bitcoin_abc, PiRK
Reviewed By: #bitcoin_abc, PiRK
Differential Revision: https://reviews.bitcoinabc.org/D14429