Block starting Tor when setup is not complete
As seen in fenix#40040 (closed), when
onStartCommand is called immediately after
onCreate there exists a race between copying the built-in assets and writing the new torrc file on disk. For the described race condition the easy solution is not copying the built-in torrc file, but then there is a chance the geoip files are not written before starting tor, so tor misses that information.
We should either move
setup out of a background thread that is started by
onCreate (and execute it on the main thread in
onCreate or simply in
startTor), or we should add a lock that prevents synchronous execution.