Prevent a queue of messages building up

This fixes a bug where if multiple messages arrived and were queued before filter-output was called then only the first would be processed. As a result the queue would never be flushed.