Improved parameterized hash test.

Dictionaries are of course not hashable. But note that hasattr(dict,
'__hash__') returns true. This is because dict.__hash__ does actually return
something. (In fact dict.__hash__ returns none. But that is enough to cause
hasattr(dict, '__hash__') to return true. Which means that hasattr() is a bad
sentinel in our hash tests.)

This commit uses getattr(dict, '__hash__', None) instead. The call returns
none.