[HttpKernel] Fix profiler event-listener usage outside request stack context
bug #9628 [2.4][HttpKernel] Fix profiler event-listener usage outside request stack context (romainneutron)

This PR was merged into the 2.4 branch.

Discussion
----------

[2.4][HttpKernel] Fix profiler event-listener usage outside request stack context

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT

The bug has been reported at https://github.com/silexphp/Silex-WebProfiler/issues/27

todo :
 - [x] add unit test

Commits
-------

55a76e7 [HttpKernel] Fix profiler event-listener usage outside request stack context