[Routing] Fixes fatal errors with object resources in AnnotationDirectoryLoader::supports

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | 
| License       | MIT
| Doc PR        | 

Fixes fatal errors that occur in the supports method with objects that aren't string convertible / don't implement ArrayAccess. This is mostly a problem because some locators try to access a specific character in the resource name.
Since the resource is checked if it's a string either way, it's the most simple solution to just move that check a bit ahead.

FileLocatorInterface allows `mixed` https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Config/FileLocatorInterface.php#L22 . But the actual implementation https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Config/FileLocator.php#L44 doesn't actually work with any parameter. So this issue is there and not really in this class here.