Thermodynamic interpretation of core-level binding energies in adsorbates