Locality of temperature in spin chains