En irakisk domstol dömde sju franska medborgare till livstids fängelse för att ha tillhört Islamiska staten.