ido_mysql: Automatically reconnect when necessary.
ido_mysql: Fix deadlock.