Gerard Deulofeu's superb first-half strike helped AC Milan keep their European hopes alive with a hard-fought 2-1 win over Fiorentina at the San Siro.