gold ends lower, tracking longest weekly losing streak since june