fix sentinel write thread id for pthread platforms