Fix extension-stripping logic.
Fix extension-stripping logic.

Trivial manual test case:
   libpython3.8.a <-> libpython3.8m.a

Existing logic erroneously reports collision on "libpython3" token.
bazelbuild/rules_foreign_cc,bazelbuild/rules_foreign_cc,bazelbuild/rules_foreign_cc,bazelbuild/rules_foreign_cc