Transition from compact to porous films in deposition with temperature-activated diffusion