Cameron Smith recorded five successive birdies to steal the lead from Rory McIlroy in the final round of The 150th Open Championship.