Fix thread safety of TThread::TThread(Long_t id)

Changing fId is a common ressource (see TThread::GetThread)
and thus its update must be locked.

(cherry picked from commit c85bd1176dee1629ac1beb0d7f57003198dd281a)