Theo Hernandez's stoppage-time winner ensured Milan ended the year top of Serie A with victory over Lazio.