America’s Kurdish allies oversaw two dozen sites holding thousands of members of the terrorist group and their families.