gold ends down first week in five as dollar gains