Temperature dependence of η and η′ production in heavy-ion collisions