Dielectric response of isolated carbon nanotubes investigated by spatially resolved electron energy-loss spectroscopy: From multiwalled to single-walled nanotubes