Instead of using $product->save()
try using the resource model, a la $product->getResource()->save($product)
.
The reason being $product->save()
will re-trigger all save events, hence running whatever is saving the cataloginventory_stock and throwing the error.