Replaced boost::thread_specific_ptr with thread_local

Our static analyzer ignores thread_local but not boost::thread_specific_ptr. It will be changed to also ignore the latter but given thread_local is part of the C++ standard and better reflects what the code was doing, I’ve switched to thread_local.