Sterile neutrinos: Cosmology versus short-baseline experiments