[FrameworkBundle], [TwigBundle] Fixed wrong paths to the resources due to the classes that are in the class cache.

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