fix #408. Make InfluxDB recover from internal bugs and panics