Gold gains as U.S. stimulus prospects offset firm dollar