Fix resource property editor incorrectly accepting script files
See discussion on #102534. Before this fix, it was possible to drag a
file `CustomResource.gd` with `class_name CustomResource` onto a
property of type `CustomResource`. Of course, the intention is that only
`Resource`s with the `CustomResource` script attached are accepted.
(Actually accepting the script, but creating a resource from it
automatically, is left as a future improvement.)