Fix for proper handling mysql connections leftovers.