ensure threads are stopped when enumerating source throws an exception