sql: keep pool slot queryCount balanced across connection death (#33743)