Binary black holes in young star clusters: The impact of metallicity