Temperature dependence of cavity-polariton energies in ZnO and CuCl microcavities