Namibia has elected Vice-President Netumbo Nandi-Ndaitwah as its first female president following a disputed election.