Fix a race condition where `stopDaemon(cleanConfig: true)` could fail to fully clean up the persistent frontier directory, leaving stale data that causes slow restarts. Shutdown handlers now execute in a guaranteed order, ensuring the frontier database is closed before its files are removed.
