Quantum-controlled measurement device for quantum-state discrimination