Electric field distribution and charge transport properties in diode-like CdTe X-ray detectors