Curry top-scored for the Warriors with 40 points as they overcame an early 22-point deficit to down the Nets