Cook Islands have booked their spot in a fourth Rugby League World Cup, turning it on to beat South Africa 58-6 in Sydney.