fix queue manipulations in text:ports-mixin

closes PR 14871

test case included in drracket repo