An analytical solution for non-steady-state diffusion through thin films