Support hostnames and IP address in text format

Hi,

I've added a really simple function that returns an  IP tuple unaltered but if given a string based hostname it will try to resolve it to an IP. It works with both hostnames and IPs although it only takes the first one. If it fails to resolve for any reason it just returns the tuple {127,0,0,1} as I wasn't sure what the best way to handle it was.

I'm sure this used to work, but when I updated to the new library today, my app stopped sending stats and I tracked it down to this.

Hopefully it will be useful - but if I've done something dumb, please feel free to point me in the right direction :)

Cheers,

Pete