use a kernel.terminate event listener instead of a bundle shutdown hook as it's not called properly at the end of each request (Symfony bug?)