Fix deadlock in ot_terminate()

The method acquires a lock on the static mutex `the_Mutex`.

It then calls itself recursively by re-throwing the exception and hangs because
it has already acquired the lock.

This freezes the process on my Linux system, but it should freeze on other
systems as well.

It's unclear what the purpose of the lock is, I'm guessing guarding the std::err
output. I moved it further down where it is less likely that a recursion
occurs. A better way would be to get rid of the mutex in this method altogether.
I left in in because I also saw it in this answer (which in all likelihood is the origin of the code): http://stackoverflow.com/questions/2443135

But looking at it again, it's probably just a workaround for not having `std::current_exception()`, right?