gold closes with minor loss, up for week