Prime Minister António Costa's Socialist Party is neck and neck with Rui Rio's Social Democratic Party.