gold extends losses to shed 3.1% in july