Temperature dependence of the electron self-energy in a polar-crystal slab