Dielectric response of ferroelectric liquid crystals in samples of finite thickness