#63683ClassLoader: Stalled Lock file if ClassLoader caching fails.
Description
In #61900 we fixed the first part, clearing cache and lock file if an exception is thrown while class cache is build.
Now we need this also for hard errors like fatals, for this we need to register our own shutdown_function like done in AbstractService.