gearmanworker for stats: fix losing database connection

as gearmanworker works in daemon mode it's losing connection to database after some time of inactivity or when database was restarted. now it tries to reconnect 2 times