Lifetimes of rovibrational levels of the long-range I′ 1Πg state of H2 and D2: experiment and theory