When running from binary, we need to fixup environment variables
before launching new processes. We also need to detach from the parent
tty, because otherwise it causes problems for PyInstaller.
Plus, when binary is built as --onefile it still creates pop-up terminal
on windows, so we need to switch to --onedir.
Fixes#1446Fixes#1444
Signed-off-by: Ruslan Kuprieiev <[email protected]>