ensure Thread::flags is always updated atomically

Since this field is sometimes updated from other threads, it is
essential that we always update it atomically.
Merge pull request #329 from dicej/atomic-flags

ensure Thread::flags is always updated atomically
Enable individual platform/arch builds by watching for platform/arch
Merge pull request #330 from sgoings/master

Enable individual platform/arch builds by watching for platform/arch