Former German defence minister is the new EU Commission president, after narrowly winning a parliament vote.