Merge pull request #2556 from sbc100/fix_warnings Fix warnings in thread-utils.h when building without -DTHREADSAFE=ON