Quantum reading of unitary optical devices