Effect of nanocavities on the thermoelectric properties of polycrystalline silicon