MFC r292360: sh: Fix use-after-free when attempting to modify a read-only variable.
Reported by: bapt