Russia and Ukraine exchanged hundreds of prisoners of war in a deal negotiated by the United Arab Emirates.