The K-core as a predictor of structural collapse in mutualistic ecosystems