Thermodynamics of the Formation of Ti-and Cr-doped CuGaS2 Intermediate-band Photovoltaic Materials