Windows: split cm_buf_t.flags field to ensure proper locking
It turns out that for all these years the locks protecting
the cm_buf_t flags field have been racy. Some of the flags
were protected by the cm_buf_t mutex and others by the
buf_globalLock. This patchset splits the flags field so that
the appropriate lock will be used exclusively to protect a
common set of flags.