UseSWIG: Restore support for like-named .i files in different modules
Fix logic added by !1457 (merged). Name the extra targets added for Makefile generators using both the module name and .i base name to avoid collisions across modules. Also make sure the extra targets added for all .i files in a module are added as dependencies instead of just the last one.
Fixes: #17704 (closed)