fix(autoload): Changed checks of relative directories in addDirectory() (refs #5191)

addDirectory() has been changed to implement the same algorithm for
handling relative directories as used in _includeAll().
Merge pull request #1360 from eguaj/3.2-A5191

fix(autoload): Changed checks of relative directories in addDirectory() (closes #5191)