John Swinney has been accused of being desperate to cling onto power after saying he expects to stand for two more terms as SNP leader.