Update torndb.py

method _ensure_connected add ping check connect