Diazotization of heterocyclic primary amines