Gold ends three-day slump, amid stronger dollar and U.S. factory orders