Unpopular Sri Lankan PM elected president; risks new turmoil