[BUGFIX] Tests: Incomplete mock of $GLOBALS['TYPO3_DB']

Still some unit tests rely on TYPO3_DB, mostly through the extbase
object manager. The patch fixes most occurrences and skips two
complex tests that should be moved to functional tests later.

This should be the final patch for tests accessing TYPO3_DB.

Change-Id: I8deb0fb9c13b47c8ce4262f041744def9e6b0e79
Resolves: #56947
Related: #51436
Releases: 6.2