Thermal cis-to-trans isomerization mechanism of N-(phenylazo)-substituted nitrogen heterocycles