Attosecond control of electron localization in one- and two-color dissociative ionization of H 2 and D 2