Read from error channel in tests before closing