Samsung shares surged after the company reached a last-minute labor deal to avoid an 18-day strike by roughly 48,000 workers.