South Korea’s prime minister and top presidential officials offer to resign after election defeat