[FrameworkBundle] Fix dependency on ExtensionInterface over implementation

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | no (but anyway, they didn't pass previously)
| Fixed tickets | #13084
| License       | MIT

When implementing `ExtensionInterface` through classes not inheriting the core `Extension`, the command `config:dump` throws.
This bug was introduced in 2.5 and could be fixed up to 2.7 with the same patch.