Jo-Wilfred Tsonga beat Roger Federer in straight sets to become the first Frenchman to win the Toronto Masters.