Klay Thompson's game-tying triple was in vain as the Pistons secured a dramatic victory over the Warriors.