Gradient correction to the statistical electronic free energy at nonzero temperatures: Application to equation-of-state calculations