(PUP-2298) add glue for resource constraints

In order to deprecate the builtin defined function (which is often abused
to work around resource duplication between modules) it is desirable to
add resource constraints to the language. An easy approach to allowing such
constraints to work is to add them as a special resource type that does not
take effect during the transaction, but fails the whole catalog in case of
validation failure.

To make this possible, add a lookup for the Type#in_valid_catalog? method
to Transaction#evaluate, in between the generation of additional resources
(which may affect the outcome of catalog consistency checks) and the start
of resource evaluation / graph traversal. Call the in_valid_catalog? method
when found, and fail the catalog if any of them return a false value.