Pacific countries select new chief diplomat after fractious vote