add spec to proof issue with variant update without product permalink.
fix the ActiveRecord::ReadOnlyRecord exception when the @product is null when update the variant

Fixes #3718
Fix ReadOnlyError when destroying StockItem

StockMovement is a readonly object so we can't delete them. And by that
logic I believe we shouldn't clear stock items from the database either
otherwise we will have stock movements associated with non existing
stock items

Fixes #3727
Fixes #3723