Upgrade of the CMS muon system with triple-GEM detectors