gold ends modestly up after two-session losses