WIP: fix persistent port allocation

This piggybacks on #6555 with some fixups according to @lk4d4's comments. More to come, but please feel free to review at any point.

/cc @crosbymichael 
possibly; it was used in some code that was supplying default variables that were no longer necessary since I added the error interface. I'll review/rewrite in a bit.