[FEATURE] Add ObjectManager->getScope like in TYPO3.Flow

This method detects if a class is of type prototype or
singleton. We need this method as it is a dependency for
further backporting of the Flow validation api.

Releases: 6.2
Resolves: #48766
Change-Id: I4d6b043a4015c31ede0b099eebed4491a38723cd
Reviewed-on: https://review.typo3.org/21189
Tested-by: Wouter Wolters
Reviewed-by: Wouter Wolters
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring