MFC r254465: Correct implementation of atomic_flag_test_and_set

(This is a direct commit to stable/9 as atomic_flag_test_and_set_explicit
is an inline function on HEAD and in a different file.)