Quantum nondemolition measurement of light intensity fluctuations in an optomechanical experiment