Mahathir wins in historic Malaysia power shift