Palladium-mediated N-arylation of heterocyclic diamines: insights into the origin of an unusual chemoselectivity.