Merge in fixes from FreeBSD trunk to make atomics work with recent clang.