The temperature-dependent Yang-Mills trace anomaly as a function of the mass gap