Three-qubit quantum error-correction scheme for collective decoherence