A General Stochastic Model for the Prediction of Biodiversity Losses Based on Habitat Conversion