The president’s party claims victory in Istanbul, but results give the opposition a slim lead.