Derivation on p.99 of Salanie, The Economics of Taxation (2nd edition)
Why are you doing $\frac{\partial^2 V}{\partial w'^2}$ ? 

Even if it is said that $w^{'}=w$ at the optimum, it should be taken different when you differentiate it for first order conditions. So, you differentiate it according to $w^{'}$ and $w$.