flatten_hard_refs should not silently allow nonsense UR::Object refs

We encountered an issue with flatten_hard_refs silently allowing garbage
rules to be created by passing over UR::Objects with missing data_types.
This prompted a cleanup of the method.