[BUGFIX] Exclude directory does not always match

Change-Id: I71f58c0beb47a0613d4ef114e62a12955b994c99
Reviewed-on: https://review.typo3.org/25274
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers