A former head of the Civil Service privately lobbied against legislation that could have meant jail terms for the behaviour exposed in the RHI scandal, it can be revealed.