closing logstash socket on terminate