Fix dependency-analysis of type/class decls
Fix dependency-analysis of type/class decls

Family instances don't define a new type, but we were bogusly
pretending they bound the family tycon.  The led to incorrect
dependencies with strange results; it showed up as Trac #5792.

This slightly hacky fix is on the branch only; I am doing a more
substantial refactoring on HEAD.

ilyasergey/GHC-XAppFix,ilyasergey/GHC-XAppFix,ilyasergey/GHC-XAppFix,ilyasergey/GHC-XAppFix