Fixed potential security/crash problem in the print redirector for Python.