Measurements of the cosmic ray muon charge ratio with the OPERA detector