Cosmological bounds on neutrino degeneracy improved by flavor oscillations