Quantum measurement of a coupled nanomechanical resonator–Cooper-pair box system