Origin of the different photoactivity of N-doped anatase and rutile TiO2