lib: removed in-library exits
Fixed unit test batch script templates

* Scripts' environment variables affect global environment, so store original values first
* Remove unnecessary PYTHONPATH setup in C++ and C# tests