First swing at handling dead databases in a smooth manner.
If a database is unreachable, we mark it as stalled. The sync containing it is marked as stalled as well.
This should allow other syncs to continue even if databases from another sync are down.
We also re-check stalled databases on startup and restore things to an active state if we can.
Still todo:
* tests
* handle other dbi databases
* handle non-dbi databases
* have mcp periodically check if we can restore stalled dbs/syncs.
* cleanup/refactor the code