Hysteresis in thermal properties of CuO and YBa2Cu3O7-x