* fixed a few thread_base issues:
   * c++ requires that when destructing a mutex it must not currently be locked (sadly, there is no way to figure out if a lock is currently held -> use a manual lock/unlock counter)
   * fixed leaking the std::thread object -> uses a unique_ptr now
   * made thread_status atomic, instead of having to lock it -> this fixes the deadlock when throwing inside the thread_base constructor or any derived class
   * fixed thread restart (delete old thread object + set the correct state, in the correct order)
   * improved thread_base::finish: check if thread object actually exists + correct joinable test, delete the thread object if it exists, always set the finished status