[TASK] Cleanup

Replace \' with " in exceptions

Add missing PHP closing tag in StoragePermissionsAspect

Restructure a select query in the
BackendUserAuthentication class.

Change-Id: Id161c761288be93b8f43a2f855254ac954c32d5b
Resolves: #51744
Releases: 6.2, 6.1, 6.0
Reviewed-on: https://review.typo3.org/23704
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring