Former South Korean spy chief jailed over election scandal