Sensitivity of the Cherenkov Telescope Array to the detection of intergalactic magnetic fields