On the Thermodynamic Stability of Amorphous Intergranular Films in Covalent Materials