[FrameworkBundle] Allow to get MasterRequest in template

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #7138
| License       | MIT
| Doc PR        | n/a

I want to get the MasterRequest in template because to get the correct REQUEST_PATH in sub-request templating (e.g. pagination).

example code:
```twig
{{ dump(app.masterRequest.pathInfo) }}
```