Fix for HzGlyph app.

Fix MgBaseShape::setFlag(): fail to call OSAtomicCompareAndSwapLong.
Not delete locked shapes.