adjust text:ports to better deal with giant amounts of bytes

by splitting them up and using separate events so other work
can also happen while the insertion is going on.

This change also changes the queue-callback for IO insertion
to be a low-priority callback. This should have been the case
before, I think, but it is a bit surprising it wasn't and so
this may also cause other problems

closes PR 14851
make <menukey>-k (kill program) clear pending io

related to PR 14851

When sending a giant bytes via write-bytes, we can get into a situation
where there are lots and lots of bytes inside the port that haven't yet
been put into the repl's text% but that will, eventually, even though
the program is dead. The commit clears out any such pending IO