Detecting ground-state degeneracy in many-body systems through qubit decoherence