Prevent "Uninitialized string offset: 0" exception when $paths is ""

Debugging the code I noticed that an exception is thrown when the $paths is an empty string. I was running `composer require jms/di-extra-bundle:dev-master` and for jms/aop-bundle $autoloadNamespaces is:
```php
array (
  'JMS\\AopBundle' => '',
)
```

Is the check ok or do you prefer `strlen($paths)`?

Should I remove the unused `$packages = array();` in line 43 while I’m at it?