Near-edge X-ray absorption fine structure study of helicity and defects in carbon nanotubes