Thermodynamics of extrinsic semiconductors with dislocations