Applied some fixes to our statsd client

Previously it would only allow you to connect directly to an ip address
even though it did a dns lookup. And it would crash because of an invalid free.
Copying code almost directly isn't always to smart ;)

Signed-off-by: Toon Schoenmakers <nighteyes1993@gmail.com>