Thermal bremsstrahlung hard X-ray and primary energy release in flares