What is the function of っ in these words ending with っこ?


I've noticed some words ending in こ which seem to insert a っ where it is
seemingly unwarranted phonetically.

Examples are 末っ子, 売れっ子, 江戸っ子, 町っ子, etc. I don't see any phonetic issues with
the 'expected' 末子 (a word in itself), 売れ子, 江戸子, 町子. So what function is this っ
performing in these words? Is it phonetic or could it be a morphemic usage,
denoting っこ as a suffix with specific semantic content?

Also, does 慣れっこ also belong to this group of words?

