Fix compilation warnings about unused variables

More recent CMSSW versions treat these as errors