[ts-next-plugin] fix: validate metadata node before checking type (#78414)
### What?
Received error from TS Log:
```txt
Cannot read properties of undefined (reading 'type')
TypeError: Cannot read properties of undefined (reading 'type')
at hasCorrectType (…/next@15.4.0-canary.3…/next/dist/server/typescript/rules/metadata.js:212:14)
at Object.getSemanticDiagnosticsForExportDeclaration (…
```
### Why?
`declaration` can be undefined but was passed via `as` assertion.
### How?
Remove the `as` assertion and correctly validate the `declaration.`