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