Foreign buying lifts KLCI to higher close