tor_run_main crashes when called a second time with --version

I wrote a testing harness that uses python and cffi, to implement some basic smoke tests for libtor. This can be found here: ​https://gist.github.com/hellais/b56043d57eb5be885958e80b3665bfe2 (to run it do pip install cffi and change the LIB_PATH to the correct path).

In particular by adding the command line flag --version and starting tor, I am unable to re-start it due to the exception listed in the above gist.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information