[FEATURE] Backport TSFE getHash hook to TYPO3 CMS 4.5

Fixes http://forge.typo3.org/issues/56269