The SNP is on course to win the upcoming Holyrood election, but will fall short of the majority John Swinney wants.