Hastings-Metropolis algorithm on Markov chains for small-probability estimation