Markov chains for Monte Carlo tests of genetic equilibrium in multidimensional contingency tables