[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/5312
Reviewed-by: Markus Klein
Reviewed-by: Sebastian Fischer
Reviewed-by: Xavier Perseguers
Tested-by: Markus Klein
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind