Please, stop cooling magma. No more viscous magna means no more earth magnetic field, hence no more magnetic shield, ie no more life.
Please, don't dig for geothermic energy. Leave alone our earth kernel.
Now let's do some math.
Mass of the earth: 5.9*10^24 kg. Apart from a very thin shell on top, most of that is at a couple of thousand degrees kelvin.
Magma has a much higher specific heat, but let's be conservative and assume all of earth has the same specific heat as iron, or about 460 J/kg
Cooling the earth by a single degree will release about 2.75*10^27 joules
The total world energy consumption from all sources in 2008 was estimated at 4.75*10^20 joules.
At that rate, cooling the interior of the earth by a single degree would power the entire world for 5,789,473 years.
And that's assuming the earth doesn't continue to generate heat from radioactive decay, tidal forces, friction etc.