Consistently check if an object is a `frozendict`.