Density profile of charged test particles diffusing in a slab of finite thickness