The United Nations said it was working on opening a humanitarian corridor in northern Iraq to allow stranded civilians threatened by jihadist fighters to flee.