Neoclassical toroidal viscosity in perturbed equilibria with general tokamak geometry