Add try/except clause around setting old_argv in case sys.argv is not defined.

sys.argv may not be defined if Python interpreter is embedded in another program.