Weak dissipation for high-fidelity qubit-state preparation and measurement