Global stocks end strong year with losses