Wrong condition in key parsing

I was unable to use this statsd plugin with keys like: logstash.host.my.zbx.key because of a condition in the key parsing.
I fixed it for my own needs

Thanks for your work ! :-)