Shock election defeat for South Korea ruling party