A couple of fixes for hie files
Fixes #20341 and fixes the scope errors in #18425
The roundtrip errors in #18425 are quite harmless and tricky to fix. The problem is that we assign inconsistent definition source spans to certain names while typechecking type/family instances for better error messages here and here
These inconsistent names show up as roundtrip errors in hie files because one of the source spans is overwritten by the other. As the source-spans are mostly the same and only differ slightly, this isn't a serious issue.