US and Iranian officials are holding talks in Muscat amid escalating tensions and a US military buildup in the Gulf.