Diffusion in flashing periodic potentials