A Scottish military instructor who betrayed the Ukrainian forces he claimed to be helping by sending their secrets to Russia has been jailed.