Improve freeze support: redirect stdout/stderr when the script is frozen (avoid Bad file descriptor error when freezing a GUI script)