Robust quantum-network memory using decoherence-protected subspaces of nuclear spins