On the mechanism of the photocyclization of azadienes