Characterization of a Triple-GEM Detector Prototype for the CMS Muon Spectrometer Upgrade with GEM Detectors