Improve graceful shutdown handling
This MR improves the handling of planned registry shutdowns.
The improvements of this MR are
- The registry attempts to close database connections on graceful shutdown.
- The number of signals that trigger a graceful shutdown are expanded.
- The app will always log when shutdown from a signal. Helpful for cases such as: gitlab#267789 (comment 431254702)