Canadian leader went from criticising to wooing China to buy output from nation's oil sands when Barack Obama stalled on Keystone XL pipeline