Portugals main center-right party narrowly defeated the incumbent Socialists but fell well short of a majority in a general election that saw far-right Chega surge to become a potential kingmaker.