Fix cache race

See above comment on `value.frozen?` being something other than `false`.