Replace all exit() calls with return code style

Currently tor uses inside of various places the exit() call, but this is not nice when you are using it as a library as it leads to the whole app crashing, while we would rather just get an exception or a proper error code.

This involves grepping tor for exit() calls and replacing them with instead return code style returns.