(#19514) Correct error message matching for Ruby 1.8.7

In Ruby 1.8.7, the error message for an attempt of mutating
a frozen hash refers to 'hash' using lower case whereas later versions
use capital 'H'. This caused two tests to fail (twice).