Improve duplicate sequence handling.  In particular, if the
packages are the same, ignore the duplicate; if they're different,
start changing the sequence identifier until we have a unique one.

That's going by the filename, not the database.