A multichannel single-photon sensitive detector for high-energy physics: the megapixel EBCCD