Gold ends at a nearly three-month low as dollar index strengthens