Temperature-Dependent Energy-Level Shifts of Spin Defects in Hexagonal Boron Nitride