Refactor: python: Libraries shouldn't call exit.
Raise an exception instead. This isn't being caught anywhere so it has
the same effect as an exit, except that we could catch it in the future
if we wanted to.
Note that there are a couple other places in the _cts module where we
are still exiting, but I think these are okay at the moment: test.py
calls sys.exit from a method named exit, and process.py calls sys.exit
from a method named exit_if_proc_running. In both of these cases, the
function name indicates it's going to exit. It's not a side effect like
it is in environment.py.