[CLEANUP] DataHandler::clear_cache()

* Improves the structure
* Removes useless if
* Retrieves the cacheManager only once

Resolves: #56879
Releases: 6.2
Change-Id: Id96a3c74a58a9ebb9eb16aa55f87791afcba6a66
Reviewed-on: https://review.typo3.org/28351
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind