std::thread is type and exception safe