Check extensions longest-first but only if filename has a period.