Gold futures post a modest gain to end two-session skid