Inverse probability weighting to estimate causal effects of sequential treatments: a latent class extension to deal with unobserved confounding