Improve redirection support of os.system