Fix compliance rules for source consumer pools.

If a system is using an entitlement whose pool has a source consumer,
which has an environment, the JSON was not serializing coming back from
the rules. In this case environment content cannot have a reference to
it's environment, as that would be a circular dependency. However the
environment was used in the hashcode method causing a NPE.

Found in Katello where environments are used.

Changed to only use environment in the hash code if there is one. This
should be safe as any situation where we're hashing environment content
objects, should mean they're already separated by environment.

Includes some logging improvements as the exception was initially being
completely hidden from us.