[BUGFIX] Use system locale when indexing external documents

If paths or filenames of external documents contain utf-8 characters
the system locale must be used. Functions like escapeshellarg and
basename are locale aware.

Change-Id: I50a73a42d60de569c63e5ba27ad6a6a3a66fd6c8
Fixes: #30244
Releases: 4.5, 6.0, 6.1, 6.2
Reviewed-on: https://review.typo3.org/26918
Reviewed-by: Markus Klein
Tested-by: Markus Klein