Restore old race detection mechanism, but new has priority over it

Few unique ships still have no factionID