How did political power in the ottoman, safavid, and mughal empires shift as a result of the economic difficulties of the latter half of the eighteenth century?