Fix resource leak in PingDB