newdb: Fix replacing formats in a book creating orphans

When replacing formats in a book with a very long title+authors on
windows, newdb could leave behind the old format file, because the
filename shortening algorithm has changed. Handle that case.