Fix for building sitemap in test environment

Hey guys.

Sinse `event_dispatcher` is just an alias of `debug.event_dispatcher` definition in test environment this code

```php
$definition = $container->getDefinition('event_dispatcher');
```

doesn't work. So i added another one check for alias existence.