Lionel Messi became the highest goalscorer in World Cup history after scoring his 17th and 18th tournament goals.