Fix a deadlock when using filewriter as output plugin.