Core-electron binding energies in free and supported metal clusters