The NATO summit has ended with leaders uniting behind common commitments - despite the meeting highlighting bitter divisions on several major issues.