Fixed "db has gone away"

Bot will now try to reconnect and try query again.
If there's a second failure, it will exit.