Setup a periodic filter flush thread.

This got lost in 9542246 and unbreaks LOGSTASH-1284.
Merge pull request #689 from bernd/LOGSTASH-1284

Setup a periodic filter flush thread. (LOGSTASH-1284)