(#21164) Raise ParseError for non-string var names

Raise ParseError rather than DevError for non-string variable names.

This is more consistent with the other validation, and also means that
we get a file and line number when hitting this error rather than just
the rather opaque message. Also inspect the variable name for good
measure.
(#21164) Don't try to look up non-string variables

Make an effort to fail with a useful error message if you attempt to
treat an undef variable as a hash or array.

Prior to 5ac681f9, puppet would return a useful message if you attempted
to treat an undef variable as a hash: "$var is not a hash or array when
accessing it with foo at /manifest.pp:123".

Following that commit, puppet fails with an extremely unhelpful: "Scope
variable name is a Symbol, not a string" because the variable is :undef.
(#21164) Add tests for useful hash access errors

Make sure we get ParseErrors that contain "not a hash or array" so it's
clear what has happened.
(#21164) Check for correct exception message