The role of the ice rules in the thermal properties of potassium dihydrogen phosphate