Integral equation technique for scatterers with mesoscopic insertions: Application to a carbon nanotube