Implemented graceful shutdown and cleanup/persisting data in other scenarios
- Graceful shutdown will persist the in-memory database to disk
- The Try/Except/Finally in main.py will do data persistence and any cleanup for other cases, like unexpected exceptions and when the program terminates as intended (e.g., data not being received anymore)