Simple (non-Unicode-safe) Levenshtein edit distance function.