[BUGFIX] Fix GeneralUtility::rmdir and usage in tests

rmdir() has some issues fixed by the patch, especially if
feeded with links:
* If target is a dead link, the link was not removed.
* If target is a link to a directory, only the link should be
  removed, but not the directory the link points to.
* If recursion is disabled, but a directory has sub files or
  directories, a warning might be raised, now suppressed
  with an @.

The method is now fully covered by tests and can handle files,
links and directories. It is now used in GeneralUtilityTest
itself to clean up any created file during tearDown, so a lot
of tests can be streamlined.

Fixes: #47459
Releases: 6.2
Change-Id: If58a6c2262165b84c4b674c1ae71fdddcbf56458
Reviewed-on: https://review.typo3.org/20095
Reviewed-by: Philipp Gampe
Tested-by: Philipp Gampe
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn