Reducing decoherence in quantum-computer memory with all quantum bits coupling to the same environment