Make Database disconnect and error suppression more robust
* Disallow $ignoreErrors in query() on deadlocks, since that would otherwise
silently rollback all changes from any other callers.
* Move recoverability checks for disconnects to canRecoverFromDisconnect().
* The first write of a DBO_TRX transaction is now considered recoverable.
* Run onTransactionResolution() callbacks on disconnect/deadlock rollback.
Some DeferrableUpdate need this to know to abort.
* Disallow $ignoreErrors on disconnects considered unrecoverable. This
makes it so that query() callers cannot cause writes from other callers
to be silently lost, which is hard to reason about.
* Moved ping() logic to simple reconnect() method and ping() simply do
a dummy SELECT, which triggeres reconnection if safe. Previously,
ping() might cause subtle partial transaction loss.
* Remove ping() from strencode(), which would cause partial transaction
loss where it actually reached.
* Remove mysqlPing() per https://bugs.php.net/bug.php?id=52561.
Bug: T142079
Change-Id: Ifb7f772ae849d67c0d92240a115c3f392e252937