S.Korean stocks end firmer as Samsung Elec recoups some losses, won rises