Lincecum helps Giants top Royals 2-1