Handle data type translation properly before transmitting to influx

This is a port of the data type handling code from the carbon writer plugin [here](https://github.com/indygreg/collectd-carbon/blob/master/carbon_writer.py).