Fixed periodic flush using patch from:
https://logstash.jira.com/browse/LOGSTASH-1317