fixed connection leak when finding sql dialect