Assure that output threads terminate.