Threshold dynamics of a delayed multi-group heroin epidemic model in heterogeneous populations