Set MYSQLI_OPT_CONNECT_TIMEOUT in mysqli

* There is no php.ini setting for this, and it is unclear how
  high the default is. The retry behavior of MediaWiki also
  makes little sense without knowing this value.
* Also removed the retry loop which will mostly result in
  giving up the position in some FIFO queue only to come
  back at the end of the line.

Change-Id: Id24f6635508ba87288a2e40f71d4e8016a1805b0