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