Canada holds off Latvia 2-1 in Olympic thriller