Added buffering when publishing to REDIS.

This brings a significant performance improvement (50%). Can
be disabled by setting flush_interval to -1.