move global state to struct to be able to handle multiple instances of the client

per https://github.com/romanbsd/statsd-c-client/issues/2 is this the pull request.