South Korean president apologizes for election defeat