Handle DNS resolution error in graphite handler

Handle DNS resolution error when using graphite handler in TCP mode. Resolves #745