terminateAndAwaitResult
Terminates tor (if it is running) and releases resources. This MUST be called before another invocation of torRunMain can be had.
NOTE: This is a blocking API and should be called from a background thread.
Return
-1
if state == State.OFF (nothing to terminate). Otherwise, the exit value of tor_run_main
.