Pop the actual connection stuff into its own callback, so that we can
retry it if the database goes away or we can't connect, initially.