[!!!][FEATURE] Implement pre- and post-hook around SELECT queries

To use in example content/record security,
a hook is implemented before and after the SELECT call.

The interface introduces a new function that needs to be
implemented to avoid breaking functionality!

The SELECT call is the only database call without such hook

Resolves: #45699
Releases: 6.1
Change-Id: I915bd2422e3d6743a408ea53af7e6491cfe2657a
Reviewed-on: https://review.typo3.org/18411
Reviewed-by: Dmitry Dulepov
Reviewed-by: Mattias Nilsson
Tested-by: Dmitry Dulepov
Reviewed-by: Wouter Wolters
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer