Stop a Postgres restart (or error) taking the whole app down

Addresses #1854.
Indeed. The time I see it happen is when the app is just idly doing nothing and I restart Postgres.