Fixed memory leaks in mysql connections during redeploy.