newmont swings to profit as gold gains