Gold logs a gain for the session, erases its loss for the week