Accurate and efficient computation of mean ionization states with an average-atom Kubo–Greenwood approach