[BUGFIX] Tests: Incomplete mocking in PreparedStatementTest

Release PreparedStatementTest from an active DB connection. The
quote tests are refactored a bit to find out in one specific test
if it is done for parameters.

Change-Id: I37853cd49368c2b23d0c2d6926fc806618674279
Resolves: #56922
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/28398
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring