MAGE-726: Fix tests
- fixed closing mysql connections after forking new thread
- fixed adding error messages to session in cli scripts