Give each type its own clause in error:has_type/2

For each type declaration or type synonym, create a single clause for
error:has_type/2.  This takes advantage of Prolog indexing to quickly
determine which clause should be used for checking a given type. It
also preserves an existing trick for iterating all known types:

     clause(error:has_type(Type,_), _).