Stephen Curry supplied a game-high 31 points as the Golden State Warriors scored a narrow 106-105 win over Toronto in Game 5 of the NBA Finals.