fix the ActiveRecord::ReadOnlyRecord exception when the @product is null when update the variant

Fixes #3718

Conflicts:
	api/spec/controllers/spree/api/variants_controller_spec.rb