Move assignment of std_handles out of try loop so that if this fails we don't try an erroneous restore.
Move assignment of std_handles out of try loop so that if this fails we don't try an erroneous restore.

solvebio/solvebio-python,solvebio/solvebio-python,solvebio/solvebio-python