Change usage of local_data_key! to thread_local!