Variation in habitat connectivity generates positive correlations between species and genetic diversity in a metacommunity