UN losing support from countries, says outgoing top official