ActionPack: Generalize error message dependant logic a bit.

Other Ruby implementations might not implement error messages the same as MRI.
For example, Rubinius has a bit different wording for NoMethodError messages.