Former public servant Richard Boyle has lost his legal bid to be declared immune from prosecution as a whistleblower, meaning he could face the prospect of life in prison.