James Anderson took the winning wicket in England's victory over India to overtake Glenn McGrath as the fast bowler with the most wickets in Test cricket.