Electron detection with CdTe and GaAs sensors using the charge integrating hybrid pixel detector JUNGFRAU