[Issue 7638] back-sql: Handle connection loss