A huge bet on solar power and a rampant gold price mean record margins for the 130-year-old mine-waste specialist