Manchester City ended their five-game winless run as Pep Guardiola celebrated victory in his 500th game in charge with a 2-0 success at Leicester.