[BUGFIX] Support mysql socket connection

With the switch to mysqli in 6.1, the connection to mysql server via
socket broke.

With mysqli, the definition is now:
* If hostname is "localhost", a socket is used and the socket file
can be given optionally if it is different from the default.
* If hostname is not "localhost" but an IP address, a port can be
given that may be different from the default mysql 3306.

The patch now reflects this in the database connect step and adds a
parameter for the optional socket location. The patch will be adapted
for 6.1 to include only the additional optional socket parameter.

Resolves: #48117
Related: #49162
Releases: 6.2, 6.1
Change-Id: I968a72dbaf90b3f319c03e697137630534d325c1
Reviewed-on: https://review.typo3.org/20933
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Markus Klein
Tested-by: Markus Klein