[BUGFIX] Alternative implementations for view helpers do not work

Extbase allows to register alternative implementations for
objects. However that does not work for view helpers using
a closing tag. The resolved (alternative) object is compared
to the name of the original view helper and throws an
exception like:

  #1224485398: Templating tags not properly nested. Expected:
  "AlternativeViewHelper"; Actual: "OriginalViewHelper"

A simple solution is to save the class name of the object returned
from the object manager in a runtime cache and check this when
resolving a view helper name. A nice side effect is, that a same
view helper name must not be calculated over and over again.

Fixes: #52272
Releases: 6.0, 6.1, 6.2
Change-Id: Ie49e5e83c779b4748dc2059f8fbc85552ce4b406
Reviewed-on: https://review.typo3.org/24057
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader