His predecessor, Pope Francis, had planned the pilgrimage to the two majority-Muslim countries before he died.