Effects of the Density of Gaseous Targets on Electron Capture and Loss by Fast Heavy Ions