Preparation of p-type CuCr1−xMgxO2 bulk with improved thermoelectric properties by sol–gel method