Reconnect on mysql timeout