Fix for building sitemap in test environment

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