[TASK] Replace direct calls to $GLOBALS['TYPO3_DB'] with a wrapper

Change-Id: Iaecccbb2fb99aeff6ece9731e722e734ea611e78
Reviewed-on: https://review.typo3.org/31451
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers