Redshift Evolution of the Electron Density in the ISM at $z\sim 0-9$ Uncovered with JWST/NIRSpec Spectra and Line-Spread Function Determinations