Origins of phase separation in thermoelectric (Ti, Zr, Hf)NiSn half-Heusler alloys from first principles