Measurement of Total Inelastic Cross Sections for Electron Impact in N2 and CO2