Symmetry-controlled singlet-triplet transition in a double-barrier quantum ring