[flang] Fix bug merging generics on USE
When we use-associate the same generic name from two different modules
they are merged together. If the same specific procedure occurs in both
generics it should only occur once in the merged one.
Similarly, it's not an error if they both have a derived type or
specific procedure named the same as the generic, as long as they are
the same symbol.
Fixes flang-compiler/f18#733.
Original-commit: flang-compiler/f18@
d37db076914ea40aece502b13b9059dc4c1b319b
Reviewed-on: https://github.com/flang-compiler/f18/pull/741
Tree-same-pre-rewrite: false