Fix name when guessed extension is empty

When extension cannot be guessed, file name ended with a dot without the extension (for example ``5113d9d14306a.``)