US dollar index hits its highest since May as war-driven oil rally boosts safe-haven demand