C backend: Improve the exceptions handling