Oil heads for weekly losses as Mideast worries ease and China