Moved the thread name handling to a separate filter.

... so that even during processing filters, the thread name would still be useful